How to debug signed Android app from Eclipse?

后端 未结 4 1152
北荒
北荒 2020-12-15 07:08

Android 2.2. I need to debug my signed APK on my Nexus S. How can this be done using Eclipse?

I start the app on my phone and then...?

相关标签:
4条回答
  • 2020-12-15 07:12

    When device connect to your eclipse running mechine , set debuggable=true in manifest file and enable debug mode in android phone it can view current running log using logcat, otherwise

    You can debug your running application using adb tools from the command line

    adb logcat - View device log

    will display the current logcat (debug messages)

    adb logcat [ <filter-spec> ]

    using you can filter only your given debug messages

    for configure debug tool view http://developer.android.com/guide/developing/tools/adb.html

    0 讨论(0)
  • 2020-12-15 07:20

    You have two ways ..

    1. You can use Log.v or log.d or Log.i (Logging) in your code and get all those logs in logcat view in eclipse while your application runs on your device.
    2. You can run (while debugging , pressing that insect icon on eclipse ) the application from eclipse on device, By putting breakpoints in your code you can debug your application.
    0 讨论(0)
  • 2020-12-15 07:24

    In Android Studio stable, you have to add the following 2 lines to application in the AndroidManifest file:

        android:debuggable="true"
        tools:ignore="HardcodedDebugMode"
    

    The first one will enable debugging of signed APK, and the second one will prevent compile-time error.

    After this, you can attach to the process via "Attach debugger to Android process" button.

    0 讨论(0)
  • 2020-12-15 07:26

    Set the debuggable=true in the manifest, export, install and sign the the app. Connect the device via USB, enable USB debugging. Then open the DDMS perspective, select the device and attach to your app's process (you will see the package name listed). If you have a rooted device, you can connect to any process if adb is running as root.

    0 讨论(0)
提交回复
热议问题