Files
adb/examples/injection/main.go
Tai Groot 2b1116d920 refactor: remove unused const and var to pass staticcheck
- Remove unused 'killed' const in util.go
- Remove unused 'command' var in examples/injection/main.go
2026-02-23 18:07:29 +00:00

29 lines
486 B
Go

package main
import (
"context"
"fmt"
"github.com/taigrr/adb"
)
func main() {
ctx := context.TODO()
devs, err := adb.Devices(ctx)
if err != nil {
fmt.Printf("Error enumerating devices: %v\n", err)
return
}
for _, dev := range devs {
if !dev.IsAuthorized {
fmt.Printf("Dev `%s` is not authorized, authorize it to continue.\n", dev.SerialNo)
continue
}
err := dev.Reboot(ctx)
if err != nil {
// handle error here
fmt.Printf("Error: %v\n", err)
}
}
}