Breakpoints in Android Platform source

前端 未结 1 1854
予麋鹿
予麋鹿 2021-02-02 15:56

Using Intellj-idea I\'m trying to debug into the Android source API 17 but when I set breakpoints in the platform source they are being ignored when run. Looking at the breakpoi

相关标签:
1条回答
  • 2021-02-02 16:18

    It depends on what application you are trying to debug: your own application, a system application such as android.process.acore.

    To debug platform source running in your own application

    The main issue is the line numbers of the platform source you have downloaded on your computer must match what is running on the device. Your best bet will be to debug on Google Nexus device such as the Nexus 5 or Nexus 7 since it should be running a compiled version of the source exactly as it was released by Google which you downloaded with the Android SDK. Just add the sourcepath to the sdk in IntelliJ, attach the debugger and set the breakpoint. Make sure you choose the same API level source as is running on the device. That should do it.

    To debug platform source running in a system application

    You will need eng build of the Android platform to debug system processes. If you haven't built and installed the Android platform before it is quite a bit of work and requires an unlocked bootloader. Maybe there are prebuilt eng builds of cyanogenmod or something that can be downloaded but I can't find any after some trivial Googling. You may also make an eng build of AOSP yourself and run the emulator on your machine. See Running emulator after building Android from source and the "Choose a target" section on the AOSP site for info on building your own eng build if you are feeling very ambitious.

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