How to shake virtual device created by Genymotion (Android Emulator) - android

I created a virtual device using Genymotion. I want to test an app that works with shaking the device. How can I make virtual device shake? I couldn't find how to shake that device.

⌘+m is working for OSX, Also Its working in Genymotion, for windows users willing to perform a shake gesture just use Ctrl+m

This method only work api under 15
For test accelerator and other like gravity,gyroscope,... can use this application.
First download sensorsimulator
This is 2 application. One install(SensorSimulatorSettings-2.0-rc1.apk) in emulator second(sensorsimulator-2.0-rc1.jar) run in your PC.
More info and full tutorial
Genymotion not support this feature :
More info Genymotion Shell
Other way :
You can use Android Studio emulator Android 6.0(Google APIS) x86.
This this emulator(All x86/x64 bit) very fast and support all sensors.
Like this:

There isn't a native way to emulate a shake in genymotion, but you could try a tool like Frappe (Mac only) to send a shake action to the virtual device. Depending on the client you are trying to emulate, "adb shell input keyevent 82" may send a shake action, wake the device, or simulate a menu key press.

For Genymotion in particular for windows use Ctrl+Shift+M.

Related

Android Studio's emulator with black screen

I have a problem when I tried to start my AVD in android studio. It was working fine but all of a sudden it just turns black. I have tried to restart my pc but it didnt help. Any solution? Or is there any AVD application that I can use because android studio's AVD is kinda slow.
This also happens to me from time to time. To fix this, open your AVD Manager. Then, click the arrow to the far right. Finally, click Cold Boot Now.
I will say it will be better if you use physical mobile devices and the step to use that is mentioned below:
Pre-requesting:
Android Studio
USB cable
Android Device
Steps:
Enable USB
debugging(Link)
Automatically get device driver install on the system.
Run your app using a connected device. check ou this link
Why I am suggesting to you because this will improve your productivity of coding.
If you want multiple device testing then only go through Virtual emulator such as BlueStack, GenyMotion, AndY which I used and prefer more due to of less memory uses.
You can try Genymotion instead. It is faster than android studio's AVD and easy to use. Also in some cases, you might have riot vanguard (riot games anti cheat system), and you need to uninstall it to use android studio's AVD.

How can we use Genymotion with Eclipse and Appium

REQUIREMENT - Need to connect a emulator with my Appium code. As my normal emulator takes even 2 days to open the menu screen, I have been trying to use "GENYMOTION" which is fast.
PROBLEM - After starting a virtual device, Looking in cmd prompt for list of devices keying "adb devices". I have my virtual device name listed as "192.168.175.101:5555". How can I connect the virual device? How can I install my app??
HELP NEEDED - Now how should I make use of Genymotion virtual device to work for my Appium automated test.
Should I make changes in the Android settings of Appium? If so explain.
Should I change the name of device in code?capabilities.setCapability("deviceName","192.168.175.101:5555");
Yes change port number in android settings and in code also both the port number should be the same i.e android settings and code port numbers.
To install the required app in connected devices follow the below points
1.Open command prompt.
2.type adb install space and then drag the apk file from the saved folder and click enter.
3.wait some time app will install and responds with success message
At maximum that you need to do is mention the device name as set in GenyMotion by you. The capability deviceName as used in android is currently ignored, you can refer the documents on appium.io
deviceName - The kind of mobile device or emulator to use iPhone
Simulator, iPad Simulator, iPhone Retina 4-inch, Android Emulator,
Galaxy S4, etc…. On iOS, this should be one of the valid devices
returned by instruments with instruments -s devices. On Android this
capability is currently ignored.
So you can continue using the line of code :
capabilities.setCapability("deviceName","192.168.175.101:5555"); //you can provide the name as "TestDevice", "Emulator" etc..
Irrespective of what name you provide, appium uses the first available device from the list of adb devices on your machine.
Also on your appium server GUI, you might want to uncheck the emulator option if you are using GenyMotion, as appium would treat it as a real device connected for automation.

USB Debugging in VitualBox-hosted Android system

I have set up a virtual machine running an Android 4.4 system on VirtualBox, in a Windows 7 system, for convenience in testing an Android app I am trying to develop. What last remains, is to be able to make the guest Android OS look like it's connected to the host via USB, to be able to use USB Debugging. Is there a way to achieve that?
EDIT: By "convenience" I mean I do not have a good enough physical device at my hands at the moment, and my processor happens not to support VT-x, in which case I could just use an AVD with Android Studio. Therefore, the VirtualBox choice is the next best thing I got, until I get a new device on my hands. What has priority at the moment is to create the app's utility, looks will be taken care of later on.
If your Android system is rooted you can install Wifi ADB (or some similar application) through Android Play store and debug over TCP.
The steps can be simply:
Install Wifi ADB (from https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=es)
Execute and start service (Bettle will go to green)
Open Command line in Windows 7 machine
Run the connection command, for example:
adb connect 192.168.125.232
Test device connection with
adb devices
Enjoy testing your application!

How to get mouseover event from android emulator

How to get x and y coordinates of mouse over.
I have a service in android and which is connected to .net application via eneter messaging framework. I wants x and y position of mouse from service. I want mouse positions not only on clicks but also on mouse over.
Many thanks
Maybe not a best solution but atleast it works.
Both solutions are based on Genymotion emulator.
Solution #1
You need to install Genymotion emulator.
Run emulator from VirtualBox app, wait a bit until you see a few lines like "init: untracked pid ... exited"
Run the same emulator from Genymotion launcher.
Now you can simulate mouse by moving it in VirtualBox app window (not genymotion window).
Depends on how long you wait before you do step 3, android can appear in genymotion or virtual box window.
Solution #2
You need to install Genymotion emulator.
Run VirtualBox app, go to your virtual box "android emulator":
Settings -> Display -> Remote Display -> Check Enable Server
Run android emulator through the genymotion launcher.
Connect to your virtualbox with:
$ rdesktop -a 16 localhost:3389
While you move cursor in rdesktop, you can see pointer in genymotion android emulator window. Now you can intercept hover events.
There is maybe a better solution - disable mouse integration for virtual machine, so, virtualbox can grab mouse cursor, like:
$ VBoxManage modifyvm "your-vm-name" --mouse ps2
but it doesn't work for me, maybe genymotion launcher overrides settings on every launch?
Links:
http://developer.android.com/reference/android/view/View.OnHoverListener.html
p.s. hover events are available starting from api 14.
You can also use Android x86 in Live CD mode (or install it in dual-boot with Windows).

How to port my own device driver on android emulator

Can anyone tell me how can i install or port my own driver(EX: Display driver) on android emulator and how to test it....
Thanks, Manju
I'm guessing you have read the Display Drivers section of the porting documention as well as bits about the Android Virtual Device (AVD) emulator configuration already. An AVD device can be configured to match your characteristics of your display, but that won't actually test your display driver. It doesn't appear that the emulator is extensible in that regard (without modifying QEMU).
So .. perhaps write an application-level test suite that runs on the emulator, and then try it on your actual device.

Categories

Resources