我想在 emulator 中使用操作 BOOT_COMPLETED 检查 BROADCAST RECEIVER.
I want to check the BROADCAST RECEIVER with Action BOOT_COMPLETED in the emulator.
有什么方法可以检查模拟器中的广播接收器吗?如何重新启动模拟器以检查该接收器?有没有直接的命令?
Is there any way to check that broadcast receiver in emulator ? How can i restart emulator to check that receiver ? is there any direct command?
提前致谢.
模拟器中没有像Devices那样的电源按钮,所以
There is no Power Button in Emulator like Devices have,So
要停止模拟器实例,只需关闭模拟器窗口即可.
为了 Start/Restart 它从 Eclipse 的 AVD 管理器开始 并且您的带有 BOOT_COMPLETE 操作的 BroadcastReceiver 将被调用肯定
And To Start/Restart it Start from AVD Manager of Eclipse and Your BroadcastReceiver with BOOT_COMPLETE action will get called for sure
你也可以用另一种方式启动 AVD,从 CMD 转到 AndroidSDK 的工具 并给出这个命令 E:android-sdk-windows ools>模拟器 -avd AVDNAMEHERE
You can start AVD another way also, From CMD go to Tools of AndroidSDK and give this commmand E:android-sdk-windows ools>emulator -avd AVDNAMEHERE
要从 CMD 发送广播,您可以使用此命令.
To Send Broadcast from CMD you can use this Command.
adb shell am 广播 -a android.intent.action.BOOT_COMPLETED -candroid.intent.category.HOME -n package_name/class_name
adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n package_name/class_name
<小时>
阅读有关 Android 模拟器的更多信息:Android 模拟器 和 使用模拟器
这篇关于如何在模拟器中测试 BOOT_COMPLETED 广播接收器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
使用 GPS 获取用户的当前位置Get user#39;s current location using GPS(使用 GPS 获取用户的当前位置)
requestLocationUpdate() 抛出的 IllegalArgumentExceptionIllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 抛出的 IllegalArgumentException)
LocationManager 的 getLastKnownLocation 有多可靠,多久更How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新
如何检测位置提供者?GPS 或网络提供商How to detect Location Provider ? GPS or Network Provider(如何检测位置提供者?GPS 或网络提供商)
在应用启动期间获取当前位置Get current location during app launch(在应用启动期间获取当前位置)
locationManager.getLastKnownLocation() 返回 nulllocationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)