Android: The right way to debug an running application (runtime errors/log)

筅森魡賤 提交于 2019-12-23 01:57:24

问题


I am new to Android development. I have been going through the tutorials.

I would like to know which is the right way to debug / log an application during its execution. I am guessing I should be able to execute my application directly on my android device and be able to view a log or so to catch runtime errors and logs?

How could I accomplish this ?

I am using this to install the application on my phone

adb install <path to apk>

p.s. I am sure this question might seem like something I should already know. But I could not figure it out :) Hence I am here :)


回答1:


You can build on the command line with ant. See this guide.

& install it by using adb on the command line.

adb install MyApp.apk

path of apk with file extension


update

for getting logcat or crash report

do this way:

adb logcat

note: make sure only one device is connected to adb bridge

for filtering:

check this & this.



来源:https://stackoverflow.com/questions/28807844/android-the-right-way-to-debug-an-running-application-runtime-errors-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!