apache / cordova-android

Apache Cordova Android
https://cordova.apache.org/
Apache License 2.0
3.59k stars 1.52k forks source link

Verify the available device before run command #1670

Open merbin2012 opened 7 months ago

merbin2012 commented 7 months ago

Most of the time the testing mobile disconnect automatically or other some reason, and when I try to run the app on the device it show this message "Could not find target matching { id: 'xxxxxxxx' }", I think must cordova run command should verify the available device then start the generating apk process. This should save developers time.

Thank you.

breautek commented 7 months ago

I don't really have any rejection of adding this verification but... there needs to be an understanding that the ADB is just simply crap. In my experience the device can disconnect from ADB at any time, including between the verification check and the time it actually tries to deploy to the device. I've had devices disconnect from ADB while actively debugging. It's truly the most frustrating experience with Android development.

A co-worker of mine has a newer device than I do that has debugging over WiFi support and he says that is more stable than debugging over USB, but he still runs into this kind of problem occasionally, just not as frequently with USB cables.