سؤال

One of my apps needs to use the motion sensor in my Android "cell phone".

Of course, I can't shake my computer by using BlueStacks.

I wonder how I can achieve the "shake" function in BlueStacks environment?

I tried left-right arrows, but it does not seem to work at all.

هل كانت مفيدة؟

المحلول

Use BlueStacks 2, it's supported. I don't think it's possible to really shake in BS1, but with BS2, you have the button in the sidebar.

BlueStacks shake button

And you have also shortcuts

نصائح أخرى

The shake feature in BlueStacks only shakes the device horizontally. To activate the debug menu in Expo, the device needs to be shaken vertically. BlueStacks only implementing horizontal shake was a poor decision.

A work-around for any device with adb debug attached is:

adb shell input keyevent 82

It's not supported yet. Just tilt with left-down and left-right keys. This was from 3 months ago: https://getsatisfaction.com/bstk/topics/shake_shake_shake_feature

You can use genymotion, its better than bluestacks. It also supports Shake feature for WeChat.

I would simply record the sensor readings from a real device shake and then make a library that dispatches a fake shake whenever I need one:

How can I unit test an Android Activity that acts on Accelerometer?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top