Skip to content

First run

Terminal window
android-emu-web

The gateway listens on 127.0.0.1, port 7300 by default. To use another port, see Command line.

On start, the gateway checks for the Android SDK, cmdline-tools, emulator, platform-tools, the system image system-images;android-34;google_apis;arm64-v8a, and at least one virtual device (AVD). It prints each missing item with a fix, in this order:

Missing What the gateway does
Android SDK or cmdline-tools Prints the download page for Google’s command line tools and the directory to unpack them into. It does not download these itself.
emulator, platform-tools, system image Prints the sdkmanager command and the approximate size, then asks [y/N].
No AVD Offers to create a default device named emu_web_default (Pixel 5 profile, 4096 MB RAM), then asks [y/N].

The default answer is N. Nothing is downloaded or created unless you type y. If you answer N, the gateway prints the commands so you can run them yourself, and keeps starting.

The Android SDK licenses must be accepted before sdkmanager installs packages. sdkmanager --licenses shows them in your Terminal, and you accept them yourself.

For example, to install the system image by hand:

Terminal window
sdkmanager "system-images;android-34;google_apis;arm64-v8a"

The gateway creates a new random token every time it starts, and opens your default browser at an address like this:

https://droid.devpier.dev/app/#port=7300&token=<token>

The port and token are after #, so the browser does not send them to the web server. The page saves them in the browser and removes them from the address bar. If your default browser is not Chrome or Edge, copy the address from Terminal into Chrome or Edge.

The first time the page connects to the gateway on your Mac, Chrome shows a permission prompt asking whether droid.devpier.dev may access your local network. Allow it. Chrome remembers the choice for the site.

If you denied it, see Troubleshooting.

If an emulator with gRPC is already running, the page shows its screen.

Otherwise pick a device in the list and start it. See Devices.

Click the screen to give it keyboard focus. Then:

  • Click to tap; drag to swipe.
  • Type on your Mac keyboard. See Keyboard and input.
  • Use the Back, Home and Recents buttons above the screen.

Press Ctrl+C in the Terminal where the gateway runs. Running emulators keep running. The next time you start the gateway, it connects to them again.

The gateway also serves the same page itself at http://127.0.0.1:7300/app/ (or the port you chose). Use it if the public page does not load or cannot connect.