Genymotion Cloud PaaS

– How to enable or disable ADB? –

 

Enable ADB

To establish the communication between your computer and Android virtual devices, follow the
steps below:
1. Log in with SSH using

ssh -i key.pem [email protected]_ip

2. Enable ADB using

setprop persist.sys.usb.config adb

ADB is now accessible using the standard 5555 TCP port. We do not recommend opening the ADB port 5555 in AWS Security Group since the ADB connection is neither secured nor authenticated. Instead, we recommend creating an SSH tunnel.

3. Create an SSH tunnel for this connection using:

ssh -i key.pem -NL 5555:localhost:5555 [email protected]_ip

Do not close this shell.

4. Open another shell to run other commands.

5. (Optional) Connect your virtual device using:

adb connect localhost:5555

This command is optional as the first virtual device might have been automatically
connected to ADB.

6. To connect other virtual devices to ADB, run commands below. Make sure you increment
the port number for every new virtual device (5556, 5557, 5558, etc.):

ssh -i key.pem -NL 5556:localhost:5555 [email protected]_ip2
adb connect localhost:5556

Disable ADB

To stop the communication between your computer and Android virtual devices, follow the
steps below:
1. Log in with SSH using

ssh -i key.pem [email protected]_ip

2. Run the shell command

setprop persist.sys.usb.config none
x