Retry adb also on Mac
On Windows AndroidQF retries to get an adb connection every 5 seconds but on MacOS androidqf exits if it can't get an adb connection
Screenshot with verbose mode
I wonder if the MacOS ADB binary sends a syscall to kill the process when it fails to find a device.
Hmm. I'm confused now.
In main.go we call adb.New(serial).
//https://github.com/mvt-project/androidqf/blob/main/main.go#L84C1-L88C3
log.Debug("Starting androidqf")
adb.Client, err = adb.New(serial)
if err != nil {
log.Fatal("Impossible to initialize adb: ", err)
}
The error "no devices connected to adb" is being returned as no devices are found.
if len(devices) == 0 {
return nil, fmt.Errorf("no devices connected to adb")
}
There is no loop around the adb.New() code so it is expected that AndroidQF dies. The loop should only run in the case where a device is detected but is not trusted yet.
The bug actually is why adb.New() appears to pass sometimes and start looping even when no device is connected??
Should be fixed in #55