如何在 Genymotion 中重启 android 设备模拟器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25739957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to reboot android device emulator in Genymotion
提问by user3926701
How can i test my application after reboot(BOOT COMPLETED) using Genymotion I am using nexus 4 as device
重新启动(启动完成)后如何使用 Genymotion 测试我的应用程序我使用 nexus 4 作为设备
<receiver android:name="com.template.SampleBootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
回答by eyal-lezmy
You can use the command line with adb reboot
. It should restart your device.
您可以将命令行与adb reboot
. 它应该重新启动您的设备。
To use adb you need to be inside the adb binary's folder. ie, <android SDK>/platform-tools/
or <genymotion folder>/tools/
if the android SDK is not installed. You can also these folders to your path to access it from anywhere.
要使用 adb,您需要位于 adb 二进制文件的文件夹中。即,<android SDK>/platform-tools/
或者<genymotion folder>/tools/
如果未安装 android SDK。您还可以将这些文件夹添加到您的路径中,以便从任何地方访问它。
回答by user3889585
works for me on mac:
在 mac 上对我有用:
- open terminal
- go to /Applications/Android Studio.app/sdk/platform-tools
- make sure adb is in directory (use ls command)
- ./adb reboot
- 打开终端
- 转到 /Applications/Android Studio.app/sdk/platform-tools
- 确保 adb 在目录中(使用 ls 命令)
- ./adb 重启
Genymotion emulator restarts...
Genymotion 模拟器重新启动...
回答by B M
You can press emulator power button. When pressed, you will see option dialog. That dialog you can choose "Restart". Hope for help.
您可以按模拟器电源按钮。按下后,您将看到选项对话框。您可以在该对话框中选择“重新启动”。希望得到帮助。
回答by tigerHyman89
Found the solution using also the answer from @eyal-lezmy and other stuff on the web. If you have more than one device running, you can reboot a specific device in this way
还使用@eyal-lezmy 和网上其他内容的答案找到了解决方案。如果您有多个设备在运行,您可以通过这种方式重新启动特定设备
- LIST DEVICES
- 列出设备
From <genymotion-installer-path>
launch
genymotion-shell
从<genymotion-installer-path>
发布开始
genymotion-shell
Inside the shell, run devices
, take note of IP address and port of the device you want to reboot and exit.
在 shell 中,运行devices
,记下要重启并退出的设备的 IP 地址和端口。
- REBOOT WITH ADB
- 用亚行重启
From <android-sdk-folder>/platform-tools
run
从<android-sdk-folder>/platform-tools
运行
adb -s <device-ip>:<device-port> reboot
回答by Dylan Pierce
When on linux I found the adb binary in /path/to/genymotion/tools/adb
在 linux 上我发现 adb 二进制文件 /path/to/genymotion/tools/adb
In my case:
就我而言:
~/genymotion/tools/adb reboot
~/genymotion/tools/adb reboot
Works like a charm.
奇迹般有效。