且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android:调试正在运行的应用程序(运行时错误/日志)的正确方法

更新时间:2023-10-11 21:59:34

你可以在蚂蚁的基础上建立命令行。 &


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 :)

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.