android - 尝试获取 Android 日志时 Adb 调用失败

标签 android macos react-native

我正在尝试访问我的 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/

相关文章:

android - 从 firebase 数据库中获取多个值

java - 应用程序在尝试打开第二个布局时已停止

python - OSX - #include "portaudio.h"生成 1 个错误。错误: command '/usr/bin/clang' failed with exit status 1

react-native - 它是否具有与box-sizing相当的功能:React Native的flexbox中的border-box?

ios - 垂直 ScrollView 与垂直导航冲突

java - 无服务器群组消息传递(聊天)Xmpp

Android MP3 : java. io.FileNotFoundException: 此文件无法作为文件描述符打开;它可能被压缩了

php - 如何在 MAMP 上显示错误?

c++ - 使用 C++ 的 OpenGL 基本三角形渲染不工作

javascript - 类型错误 : Cannot read property 'receiptnumber' of undefined in react native