adb (Android Debug Bridge) is how your desktop talks to an Android device. An emulator counts as a device. Once it’s connected you can install apps, read logs, open a shell, and forward ports.
Already have Android Studio? It ships
adband the emulator inside your Android SDK. You can skip downloading in step 1 and just add them to yourPATHin step 2.
Get adb (SDK Platform-Tools)
If you don’t use Android Studio, download Google’s standalone Platform-Tools package (latest is 37.0.1, July 2026) and unzip it.
cd ~
curl -LO https://dl.google.com/android/repository/platform-tools-latest-linux.zip
unzip platform-tools-latest-linux.zip
# adb is now in ~/platform-tools/cd ~
curl -LO https://dl.google.com/android/repository/platform-tools-latest-darwin.zip
unzip platform-tools-latest-darwin.zip
# adb is now in ~/platform-tools/cd $HOME
curl.exe -LO https://dl.google.com/android/repository/platform-tools-latest-windows.zip
Expand-Archive .\platform-tools-latest-windows.zip -DestinationPath $HOME
# adb.exe is now in $HOME\platform-tools\Nothing to run on for this part.
The emulator itself is not in Platform-Tools. Install it in Android Studio under SDK Manager → SDK Tools → Android Emulator.
Put adb and the emulator on your PATH
Point ANDROID_HOME at your SDK folder and add platform-tools and emulator to PATH. The paths below are Android Studio’s default SDK locations. Change them if you installed the SDK somewhere else.
echo 'export ANDROID_HOME="$HOME/Android/Sdk"' >> ~/.bashrc
echo 'export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator"' >> ~/.bashrc
source ~/.bashrcecho 'export ANDROID_HOME="$HOME/Library/Android/sdk"' >> ~/.zprofile
echo 'export PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator"' >> ~/.zprofile
source ~/.zprofile$sdk = "$env:LOCALAPPDATA\Android\Sdk"
[Environment]::SetEnvironmentVariable("ANDROID_HOME", $sdk, "User")
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$userPath;$sdk\platform-tools;$sdk\emulator", "User")
# Close and reopen Windows Terminal so the new PATH is picked up.Nothing to run on for this part.
Used the standalone zip from step 1 with no Android Studio? Add
~/platform-tools(Windows:$HOME\platform-tools) toPATHinstead.
Check that adb works
adb versionAndroid Debug Bridge version 1.0.41
Version 37.0.1-...
Installed as /.../platform-tools/adbNothing to run on for this part.
Find your virtual device’s name
List the AVDs you’ve created. Copy the one you want into Your values → Virtual device (AVD) name.
emulator -list-avdsPixel_8_API_35
Medium_Phone_API_36Nothing to run on for this part.
Linux: check that hardware acceleration (KVM) is available with
emulator -accel-check. Without it the emulator is very slow or won’t start.
Start the emulator
Run this in its own terminal tab. It keeps running while the emulator is open.
emulator -avd Pixel_8_API_35Nothing to run on for this part.
Useful options: -no-snapshot-load for a cold boot, -wipe-data to factory-reset the device, and -no-window to run headless on a server or in CI.
Newer option: Google now marks the standalone
emulatortool as deprecated in favour of the Android CLI. If you have it installed,android emulator listandandroid emulator start Pixel_8_API_35do the same thing (add--headlessfor no window).
Confirm adb sees the emulator
In a second terminal:
adb devices -lList of devices attached
emulator-5554 device product:sdk_gphone64_x86_64 model:sdk_gphone64_x86_64 device:emu64xa transport_id:1Nothing to run on for this part.
If it says offline, wait for the emulator to finish booting. Each emulator uses two ports: a console port (5554) and an adb port (5555). A second emulator gets 5556/5557, and so on, so its serial is emulator-5556.
Install your app
Use -s to choose the device when more than one is connected.
adb -s emulator-5554 install app/build/outputs/apk/debug/app-debug.apkPerforming Streamed Install
SuccessNothing to run on for this part.
Open a shell, read logs, take a screenshot
# Interactive shell on the device (type `exit` to leave)
adb -s emulator-5554 shell
# Live logs (Ctrl+C to stop)
adb -s emulator-5554 logcat
# Screenshot straight to your desktop
adb -s emulator-5554 exec-out screencap -p > screen.png# Interactive shell on the device (type `exit` to leave)
adb -s emulator-5554 shell
# Live logs (Ctrl+C to stop)
adb -s emulator-5554 logcat
# Screenshot: save on the device, then pull it to your PC
adb -s emulator-5554 shell screencap /sdcard/screen.png
adb -s emulator-5554 pull /sdcard/screen.png .Nothing to run on for this part.
On Windows, PowerShell’s
>can corrupt binary data, so the screenshot is saved on the device first and then copied withadb pull.
Let the emulator reach a server on your desktop
Run your dev server (Metro, Vite, an API…) on your desktop. Then adb reverse makes localhost:8081 inside the emulator point to the same port on your desktop.
adb -s emulator-5554 reverse tcp:8081 tcp:8081
adb -s emulator-5554 reverse --listUsbFfs tcp:8081 tcp:8081Nothing to run on for this part.
Reverse rules need Android 5.0+ and are lost when the emulator restarts or the adb server restarts, so run this again after either. The opposite direction also works. adb forward tcp:6100 tcp:7100 sends your desktop’s port 6100 to port 7100 on the device.
Troubleshooting
adb: command not found / 'adb' is not recognized: your PATH change hasn’t loaded. Open a new terminal, or run source ~/.bashrc (Linux) or source ~/.zprofile (macOS).
The emulator is running but not in adb devices: restart the adb server:
adb kill-server
adb start-server
adb devicesNothing to run on for this part.
more than one device/emulator: add -s emulator-5554 to the command, or set ANDROID_SERIAL=emulator-5554 for the session.
The emulator won’t start on Linux: run emulator -accel-check. If KVM isn’t available, turn on virtualization (VT-x/AMD-V) in your BIOS/UEFI.
Clean up
# Remove port reverses and stop the emulator
adb -s emulator-5554 reverse --remove-all
adb -s emulator-5554 emu killNothing to run on for this part.
Sources
Commands checked against these official sources on 4 Nov 2026. Found something out of date? Open an issue.