Android – How to shake an Android Emulator device in Android Studio 3.0

androidandroid-emulatorandroid-studio

I need to test a newly developed app on multiple Android device emulators through Android Studio.

This app has multiple environments wherein this is hosted, like, qa, UAT, Production. I can change the environment through a screen that comes only after shaking a real device.

Unfortunately, Android Studio 3 does not give a direct option to shake the device. How can I achieve this shake action in the emulator ?

Best Answer

Try

Ctrl + m for windows

⌘ + m for Mac OS-X

Ok Try this ... Goto Setting->Virtual Sensors in emulator menu

Click on Move checkbox

Now try moving X Y Z seekbar

You can use this code snap to detect shake ShakeDetectionDemo

Emulator

move emulator