我正在尝试访问我的 React Native 应用程序的日志。
为此,我正在运行:
react-native log-android
但是,我遇到了这个问题:
error: more than one device/emulator
adb invocation failed. Do you have adb in your PATH?
(node:24464) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): undefined
(node:24464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
adb
肯定在我的路径中,所以这不是问题。
我只打开了一个 Android 模拟器。
知道还有什么可能导致这种情况吗?
最佳答案
尝试运行 adb devices
。不止一个吗?如果是这样,请关闭您已连接的额外设备。有时您连接的手机将算作一个设备。您还想要一个 export PATH=$PATH:{YOURANDROIDTOOLS}
(类似于/Users/{USER}/Library/Android/sdk/tools
或/Users/{USER}/Applications/Genymotion.app 如果您使用的是 genymotion)在您的 zshrc 或配置文件中
关于android - 尝试获取 Android 日志时 Adb 调用失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46493449/