I\'m building a project with Cordova. On iOS, the workflow seems about what I was expecting but on Android it\'s quite the balancing act and I\'m not entirely sure how to fix. I
You are obviously experiencing a race condition where adb
device is already enumerated/connected but not yet authorized. You could either wait for cordova
to fix their code to eliminate the race condition altogether (or maybe even do it yourself) or just use userdebug
(or eng
) Android image with ro.adb.secure=0
This doesn't seem to be the answer - upon some more time, I'm still receiving
Error: Failed to execute shell command "getprop,dev.bootcomplete"" on device: Error: adb: Command failed with exit code 1 Error output:
error: device unauthorized.
I removed my avd device and created a new one. Additionally I updated loadUrlTimeoutValue
to be a bit higher and everything started working.
I am facing the same problem.
Sometimes it helps to run:
adb kill-server
adb forward --remove-all
adb start-server
However, I still have to run this from time to time and it can't be the perfect solution.
UnhandledPromiseRejectionWarning: CordovaError: Failed to execute shell command "getprop,dev.bootcomplete""
Combined it all - and it worked
config.xml
<preference name="loadUrlTimeoutValue" value="700000" />
command -
adb kill-server
adb forward --remove-all
adb start-server
The possible solutions for this inconsistent scenario is as follows:
Add this preference in you config.xml under android platform:
<preference name="loadUrlTimeoutValue" value="700000" />
Kill and restart adb server before every launch
Try creating a new AVD and mention it as target while launching the AVD
Remove and re-add android platform and rebuild the same
Hope it helps.
UPDATE: preference snippet added