Remote Android emulator

Update: According to a comment, this does no longer work due to cryptographical authentication!

I often use the Android emulator to check my apps with different display configurations and to stress-test them. But the problem is that it is really slow on my development laptop. So I installed the Android emulator on my desktop PC running Windows and connect to it over my LAN. The major advantage is that you can continue using your development machine while a “server” deals with emulating – one could even emulate several devices at once and still continue programming.

The approach in a nutshell: Forward the emulator’s port so that it is accessible in the local network. Then connect the ADB to it.

On your desktop – the “server”:

  1. Store the executable of Trivial Portforward on the desktop system (e.g. directly in C:\trivial_portforward.exe).
  2. Create a virtual device to emulate (HowTo) and name it “EmulatedAndroid”.
  3. Create a batch file:
    <your-android-sdk-path>\tools\emulator -avd EmulatedAndroid &amp; 
    echo 'On the development machine: adb kill-server and then: adb connect <desktop-pc-name>:5585'
    C:\trivial_portforward 5585 127.0.0.1 5555

  4. If you execute this batch file on your desktop PC, it will open the emulator with the specified virtual device.

Now on your laptop – the “client”:

  1. Now – given that both systems are in the same network – you can connect to the emulator from your laptop by typing in a terminal:
    adb kill-server
    adb connect <desktop-pc-name>:5585

  2. Now you can upload apps, access the logcat and execute adb commands on your remote emulator like on any other Android device. And all without performance impairments on your workstation.
  3. If you are experiencing communication losses, increase the emulator timeout in the eclipse settings to maybe 5000 ms (Window → Preferences → Android → DDMS → ADB connection time out (ms)).

3 thoughts on “Remote Android emulator

  1. Hi,
    I am trying your solution but I cant do it work.
    I am getting the error:
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>adb connect 192.168.0.107:5585
    failed to connect to 192.168.0.107:5585
    I have this:

    DESKTOP (AMD) NOTEBOOK (INTEL)
    VISUAL STUDIO EMULATOR ANDROID

    I have a desktop running win 10 pro, and a notebook running win 10 pro too.
    My desktop has an old AMD processor so, I cant use it to run any emulator. So I wanna connect an emulator on notebook (Intel), debugging on desktop (with Visual Studio). I would like to see the emulator on my IDE, to debug my project running the code on desktop (Amd), and showing the app running on emulator, on notebook (Intel).

    May you help me ?

    My email for contact is olivertech@terra.com.br

  2. No longer works as of Android 4.4. Emulator connections are now cryptographically authenticated, and the authentication fails on a forwarded port. Just to save anyone else who tries this a days worth of hair pulling and agonizing.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.