raphinesse opened a new pull request #1095:
URL: https://github.com/apache/cordova-android/pull/1095


   If the `lookHarder` option is true and the initial `adb devices` run
   returned no devices, `device.list` will kill the adb server and try
   again.
   
   Unfortunately `adb devices` contains incorrect information when it is
   run too soon after the adb server has been restarted. Consider below
   commands being executed with one running emulator:
   
       adb devices && killall adb && adb devices && adb devices
   
   While the first invocation of `adb devices` lists the emulator as
   running, the second and third one will list it as offline. This is
   especially problematic if code contains a sequence such as:
   
       devs = await device.list(true);
       emus = await emulator.list();
   
   In that case the third invocation of `adb devices` occurs in
   `emulator.list()` but because of the `killall` it lists all emulators as
   offline, causing `emus` to be empty.
   
   This commit tries to work around that issue by explicitly restarting the
   adb server after it was killed, and waiting for 100 ms after that. Local
   experimentation has shown this to be sufficient in all instances. YMMV
   of course.
   
   Fixes the problem found by @breautek when reviewing #1082


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to