您的位置:首页 > 移动开发 > Android开发

Get Android stack trace from device using Debug Bridge

2013-06-12 20:06 507 查看
Instead of crashing, sometimes your Android application will stop responding and dump a stack trace to the device. You probably will not be able to access this using Android
File Transfer, and if you view it using the Dalvik
Debug Monitor Server (DDMS) the data directory will probably appear empty.

You can get the file using the Android Debug Bridge (ADB)
however. The easiest way to set this up is to create a symlink (on a Mac, easier to add the path in Windows I imagine) to adb from /usr/sbin/. The command will depend on where you installed the Android SDK…

sudo ln -s /usr/local/android-sdk-macosx/platform-tools/adb /usr/sbin/

You can then run the following command in the directory where you want to pull the file to

adb pull /data/anr/traces.txt

You should get some output showing that the transfer took place

3622 KB/s (245506 bytes in 0.066s)



[/code]

?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: