adb reboot broadcast 在某些应用程序上不起作用
adb reboot broadcast doesn't work on some app
我已经使用 this 问题来测试我自己的应用程序的重启广播。
即,
C:\Eclipse\sdk\platform-tools>adb shell am broadcast -a
android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME
-n my.own.app/.BRAutoStart Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED
cat=[android.intent.category.HOME] cmp=my.own.app/.BRAutoStart }
Broadcast completed: result=0
但是没用。
简单命令重启设备:
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c
android.intent.category.HOME
我知道广播接收器 BRAutoStart 接收 boot_completed
,因为我已经测试过它并在生产代码中使用它。
我用的是真机,不是模拟器。
如何设置命令行向设备发送广播?
你可以试试这个电话:
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n your.app.packagename/.YourReceiverClassName
它不会重启您的设备,但会向您的接收器发送广播
我已经使用 this 问题来测试我自己的应用程序的重启广播。 即,
C:\Eclipse\sdk\platform-tools>adb shell am broadcast -a
android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME
-n my.own.app/.BRAutoStart Broadcasting: Intent { act=android.intent.action.BOOT_COMPLETED
cat=[android.intent.category.HOME] cmp=my.own.app/.BRAutoStart }
Broadcast completed: result=0
但是没用。
简单命令重启设备:
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c
android.intent.category.HOME
我知道广播接收器 BRAutoStart 接收 boot_completed
,因为我已经测试过它并在生产代码中使用它。
我用的是真机,不是模拟器。
如何设置命令行向设备发送广播?
你可以试试这个电话:
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -n your.app.packagename/.YourReceiverClassName
它不会重启您的设备,但会向您的接收器发送广播