android tips 8 | mystra,Android Debugging Tips

这篇博客记录了一个Android新手遇到的问题,即应用崩溃日志未显示在LogCat中。作者发现实际上是由于设备未正确连接导致的。解决步骤包括确保ADB识别到设备,开启手机的调试模式,并在manifest中设置`android:debuggable=true`。经过这些操作,作者成功获取到设备的日志并能看到崩溃异常。
摘要由CSDN通过智能技术生成

This is a total longshot, but is what turned out to be the answer for this Android newbie: are you sure your device is connected?

What happened in my case (that brought me here, thinking my app wasn't reporting crashes to LogCat) is that what I thought I was debugging turned out not to be my phone, but the Android emulator that I happened to have running at the same time. When I realized that this was happening, I quit the emulator, and the logcat stopped.

When I ran logcat again, it turns out it wasn't even finding my phone:

$ ./adb logcat

- waiting for device -

From there, I had to go through some hoops to get my phone to be recognized, such as adb not finding my device / phone (MacOS X) and enabling debugging on the phone. Lastly, I had to set android:debuggable=true.

After killing adb and running logcat again, I was looking at the right logs, and could see the crash exceptions.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值