How To Test BOOT_COMPLETED Broadcast Receiver In Emulator(如何在模拟器中测试 BOOT_COMPLETED 广播接收器)
问题描述
我想在 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 广播接收器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在模拟器中测试 BOOT_COMPLETED 广播接收器
基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01