【问题标题】:getting error while using logcat for checking logs of an app in linux使用 logcat 检查 linux 中的应用程序日志时出错
【发布时间】:2018-01-03 13:13:50
【问题描述】:

我想知道我的 android 应用程序的错误,所以我尝试使用 logcat 查看它的日志并按照以下步骤操作:-

You need to use adb server.
1. Connect your android with your laptop/pc 
2. Go to developer options and turn on the stay awake and USB debugging options. (Your phone) 
3. In your terminal, type "sudo adb kill-server" and then "sudo adb start-server".
4. Type "adb devices" (this should give list of devices connected)
    List of devices attached 
    you_device_name device

5. "cd" to your folder where you have made your build.
6. Type "buildozer android debug deploy run logcat > logcat.txt"
this saves the logs (for the entire process) in a file logcat.txtx in the same folder and also deploys you app on the phone.
Go through it and find your error.
7. keep your phone awake.(do not lock it).

但是当我运行第 6 步时,它会说:-

error: device 'adb' not found
- waiting for device -

我在互联网上搜索了很多次,最后我在这里发帖寻求解决方案

【问题讨论】:

  • 运行adb devices 时会发生什么?您的设备是否检测到正确的权限?你能发布输出吗?
  • @SrinivasSuresh 这是结果:- root@kali:~# adb devices 连接的设备列表 * 守护程序未运行。现在在端口 5037 上启动它 * * 守护进程已成功启动 * efeb26190903 设备
  • 很好,您确定您已启用 USB 调试并关闭了设备上的 RSA 指纹弹出窗口,对吗?如果是这样,当您连接设备并运行adb logcat 时会发生什么?
  • @SrinivasSuresh 在运行 adb logcat 连续日志或任何数据时,是的,我启用了 USB 调试,但不确定 RSA 指纹弹出
  • 但我正在执行上面给出的第 6 步

标签: adb logcat android-logcat buildozer usb-debugging


【解决方案1】:

我实际上最初误读了推土机错误。它抱怨设备adb 不存在。这很奇怪。它应该取而代之的是设备序列号。

理论上,您可以通过执行
export ANDROID_SERIAL= <your device's serial number>

来强制 adb 命令进入您的设备

您现在可以重复这些步骤并检查是否可行。

也只是为了完整起见,只需检查设备的系统分区中是否存在 adb 二进制文件。

还要确保您没有错过任何推土机初始化步骤

【讨论】:

  • 感谢您的支持,但您提供的这个解决方案没有奏效
猜你喜欢
  • 2011-05-24
  • 2016-11-19
  • 2014-04-20
  • 2021-10-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-07
  • 1970-01-01
相关资源
最近更新 更多