Cordova and adb-server issue

后端 未结 5 578
孤独总比滥情好
孤独总比滥情好 2021-02-09 07:31

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

相关标签:
5条回答
  • 2021-02-09 08:10

    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

    0 讨论(0)
  • 2021-02-09 08:15

    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.

    0 讨论(0)
  • 2021-02-09 08:17

    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.

    0 讨论(0)
  • 2021-02-09 08:22

    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
    
    0 讨论(0)
  • 2021-02-09 08:26

    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

    0 讨论(0)
提交回复
热议问题