How can i test my application after reboot(BOOT COMPLETED) using Genymotion I am using nexus 4 as device
<receiver android:name="com.template.SampleBootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
You can use the command line with adb reboot. It should restart your device.
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.
works for me on mac:
- open terminal
- go to /Applications/Android Studio.app/sdk/platform-tools
- make sure adb is in directory (use ls command)
- ./adb reboot
Genymotion emulator restarts...
You can press emulator power button. When pressed, you will see option dialog. That dialog you can choose "Restart". Hope for help.
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
- LIST DEVICES
From <genymotion-installer-path> launch
genymotion-shell
Inside the shell, run devices, take note of IP address and port of the device you want to reboot and exit.
- REBOOT WITH ADB
From <android-sdk-folder>/platform-tools run
adb -s <device-ip>:<device-port> reboot
When on linux I found the adb binary in /path/to/genymotion/tools/adb
In my case:
~/genymotion/tools/adb reboot
Works like a charm.
来源:https://stackoverflow.com/questions/25739957/how-to-reboot-android-device-emulator-in-genymotion
