Is it possible to change the device pose programatically under Virtual sensors shown in the image?
I am able to change some sensors using using the following command for e.g.
string command_gyro = "sensor set gyroscope " + 0 + ":" + 0 + ":" + i;
_driver.ExecuteScript("mobile: execEmuConsoleCommand", new Dictionary<string, string>
{
{ "command", command_gyro },
});
https://stackoverflow.com/questions/70101598/android-emulator-device-pose
Thanks!
I could not find a way to change the rotation or move using either of those commands. Any idea how to specifically change those?
(Screenshot for move)
I tried the following which does not work unlike the execEmuConsoleCommand command -
_driver.ExecuteScript(“mobile: sensorSet”, new Dictionary<string, string>
{
//{ “sensorType”, “move” },
{ “sensorType”, “gyroscope” },
{ “value”, “0:0:0” }
});
you are right. The sensorSet mobile command was added a while ago and should be updated to support the most recent emulator features. For now execEmuConsoleCommand
would be the only way to achieve what you need
For time being camera/device pose reset can be achieved by rotating multiple times which resets the rotation x,y,z.
_driver.ExecuteScript("mobile: execEmuConsoleCommand", new Dictionary<string, string> { { "command", "rotate" } });