我在哪里可以查看日志,如果我已经在电话上安装的应用程序?
我在哪里可以查看日志,如果我已经在电话上安装的应用程序? 例如像
Where I can see the Log, If I have installed application on Phone? Example like
Log.v(TAG,现状是 - +状态);
我的应用程序崩溃时,来电来。所以,我怎么可以跟踪日志或错误?
My application is crashing when incoming call comes. So how can I trace the Log or Error?
如果您已经安装了亚洲开发银行(作为我认为你这样做),你只需通过USB将手机连接到你的电脑,启用调试模式,输入:
If you have ADB installed (as I assume you do), you just connect your phone to your computer via USB, enable debugging mode, and type in:
adb -d logcat
从您的计算机上的命令行。大量的输出会显示出来,并且可以滚动找到你正在寻找的输出。
from the command line on your computer. A lot of output will show up, and you can scroll through to find the output you are looking for.
您也可以只显示特定的标记,如 FOOBAR
:
You can also show only specific tags, such as FOOBAR
:
adb -d logcat -s FOOBAR
通过使用此命令,可以过滤出未捕获的异常,这是非常有用的调试:
By using this command, you can filter out only uncaught exceptions, which is useful for debugging:
adb -d logcat -s AndroidRuntime:E
您可以阅读更多有关的logcat 这里。
You can read more about logcat here.