Skip to content Skip to sidebar Skip to footer

Cordova And Adb-server Issue

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. Initial

Solution 1:

The possible solutions for this inconsistent scenario is as follows:

  1. Add this preference in you config.xml under android platform:

    <preference name="loadUrlTimeoutValue" value="700000" />

  2. Kill and restart adb server before every launch

  3. Try creating a new AVD and mention it as target while launching the AVD

  4. Remove and re-add android platform and rebuild the same

Hope it helps.

UPDATE: preference snippet added

Solution 2:

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.

Solution 3:

Update:

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.

Original

I removed my avd device and created a new one. Additionally I updated loadUrlTimeoutValue to be a bit higher and everything started working.

Solution 4:

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

Solution 5:

UnhandledPromiseRejectionWarning: CordovaError: Failed to execute shell command "getprop,dev.bootcomplete""

Combined it all - and it worked

config.xml

<preferencename="loadUrlTimeoutValue"value="700000" />

command -

adb kill-server
adb forward --remove-all
adb start-server

Post a Comment for "Cordova And Adb-server Issue"