【问题标题】:cordova emulate android fails with "device is still connecting"cordova emulate android 因“设备仍在连接”而失败
【发布时间】:2018-11-16 18:28:46
【问题描述】:

我正在尝试安装一个全新的 cordova 项目,但我无法让它在模拟器中运行。当我运行cordova emulate android 时,它给了我以下错误:

(node:4822) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to execute shell command "getprop,dev.bootcomplete"" on device: Error: adb: Command failed with exit code 1 Error output: error: device still connecting

它确实启动了模拟器,但没有任何反应。我在我的 config.xml 中添加了这个首选项:

<platform name="android">
    <allow-intent href="market:*" />
    <preference name="loadUrlTimeoutValue" value="700000" />
</platform>

【问题讨论】:

    标签: android macos cordova


    【解决方案1】:

    尝试启动模拟器(手动启动,或者在上次尝试时不要关闭它),然后运行您的命令(再次)。

    【讨论】:

      【解决方案2】:

      你还有这个问题吗? 我遇到了同样的问题,问题是设备确实还在连接

      只需在第 344 行的 if 子句或 module.exports.wait_for_emulator 方法中编辑 platform/android/cordova/lib/emulator.js 添加 (error.message.indexOf('device still connecting') &gt; -1) 即可立即修复它,这样进程就不会终止,而是继续循环直到它可以启动 adb.shell。

      希望对你有帮助。

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-06
      • 2018-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-09
      • 1970-01-01
      • 2020-05-30
      • 1970-01-01
      相关资源
      最近更新 更多