Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug an Android application using ADB/AM? [duplicate]

I am using AIDE as an Android IDE. This application built my project successfully and produced the corresponding APK file.

I would like to debug my project. Currently I:

  • open a terminal emulator

  • move to my android project (# not necessary action as app was installed )

    $ cd /sdcard/AppProjects/myproject
    
  • start adb

    $ adb shell
    
  • launch my application with am

    $ am start --user 10 -a android.intent.action.MAIN -n org.package.app/org.package.app.MainActivity
    

But how do I debug this application?

like image 405
bioinfornatics Avatar asked Oct 20 '22 13:10

bioinfornatics


1 Answers

According to the documentation, you should use start -D to enable debugging. So you would use something like this:

adb shell am start -D --user 10 -a android.intent.action.MAIN -n org.package.app/org.package.app.MainActivity

Also, your application needs to be set as debuggable in your manifest (AndroidManifest.xml):

android:debuggable="true"
like image 105
Micer Avatar answered Oct 23 '22 09:10

Micer