How to use Android emulator via VNC

I want to provide access to the Android emulator through VNC so that people can test my application.

So far, I could run the Android emulator with the following command:

emulator -avd ice -verbose -qemu -vnc :2 

I could connect to it through port 5902 , but I can’t do any input, I don’t know how to redirect the mouse to qemu.

+6
source share
2 answers

I think the -qemu -vnc option will not work to enter the Android emulator. There are two hints: (1) the "-vnc" parameters are directed to qemu instead of android-emulator, and qemu-vnc may not support Android inputs (2) the VNC protocol does not define "drag and drop" / "move", which is a common operation for mobile devices.

However, for your requirement there is a solution:

Thus, your emulator screen is similar to the "-qemu -vnc: 2" effect with an input. BTW, "drag" is still not working.

+5
source

This can be done by running the vnc server on your computer on the display :2 , telling the Android emulator to use this display and running the emulator:

 vncserver :2 -geometry 1080x1920 -depth 24 export DISPLAY=2 emulator -avd avd_name -qemu 

For Linux, there are several vnc servers. I recommend tightvnc (tightvncserver package on Ubuntu).

vncserver will probably run your xstartup script located in the .vnc folder in your home folder. If you do not want this, just comment out all the lines in this file (deleting the file will not help).

geometry should be the screen size of your avd. And he should not have skin.

0
source

Source: https://habr.com/ru/post/928203/


All Articles