使用logcat检查linux中的应用程序日志时出错

时间:2017-07-27 17:07:10

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

我想知道我的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 -

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

1 个答案:

答案 0 :(得分:0)

我发布这个作为答案,因为我不想在评论中进行长时间的讨论[所以请不要投票,否则不要投票,除非这有效]

我实际上最初误读了推土机错误。它抱怨设备 <FormGroup> <Col componentClass={ControlLabel} sm={3}> Birth Date </Col> <Col sm={9}> <DropdownButton title="Month" id="birth-month"> {createMonthSelectItems()} </DropdownButton> <DropdownButton title="Day" id="birth-day"> {createDayOfMonthSelectItems()} </DropdownButton> <DropdownButton title="Year" id="birth-year"> {createYearSelectItems()} </DropdownButton> </Col> </FormGroup> 不存在。这很奇怪。它应该已经取代了设备序列。

理论上,你可以通过执行
来强制adb命令进入你的设备 adb

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

同样只是为了完整性,只需检查设备的系统部分中是否存在export ANDROID_SERIAL= <your device's serial number>二进制文件。

另外请确保您没有错过任何推土机初始化步骤