I am having trouble debugging some code in my DeviceBootReceiver (handles android.intent.action.BOOT_COMPLETED intent). I want to debug this bit, but how does one keep the debugger alive, when the device reboots? Is there any hack that anyone has come across for this?
What I want to do :
Any thoughts?
This will make sure that when your app is executed, for example when it receives a BOOT_COMPLETED
broadcast, the debugger gets attached first.
Hope it helps.
您可以通过 adb shell 自己重新广播意图:
$ adb shell am broadcast -a android.intent.action.BOOT_COMPLETED
It takes about 30 seconds AFTER your device becomes available for interactions for android.intent.action.BOOT_COMPLETED to be broadcast. You have enough time to start up your application and enter debug mode manually
You might want to print a timestamp to your logcat when the android.intent.action.BOOT_COMPLETED intent is received so you have a better idea of when all this happens
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.