If you’ve ever run a React Native or Expo app on an Android device, you’ve used adb even if you never typed it. It sits under Android Studio, under npx expo run:android and under the “Run” button of almost any mobile tool. Most days you don’t need to know it exists. The day something breaks (the phone doesn’t show up, the app can’t reach your local server, you need a log the screen doesn’t show) is when it pays to understand it.
What it is
adb (Android Debug Bridge) is a command-line tool for talking to an Android device: a phone over USB, one over Wi-Fi or an emulator. With it you install apps, read logs, open a shell inside the device, copy files and forward ports.
It isn’t a single program, it’s three pieces:
- The client: the
adbcommand you type in your terminal. - The server: a background process on your computer, listening on port
5037. It starts on its own the first time you run a command, and it’s the one that manages the connections to the devices. - The daemon (
adbd): runs inside the phone or the emulator and executes what the server asks for.
Knowing there’s a server in the middle explains half of the weird problems. When something hangs, restarting it almost always fixes it:
adb kill-server
adb start-serverInstalling it
adb ships in the Android SDK Platform Tools. If you already have Android Studio, you already have it in the SDK folder (on macOS, ~/Library/Android/sdk/platform-tools/). If you don’t want to install all of Android Studio, on macOS Homebrew is enough:
brew install --cask android-platform-tools
adb versionOn Windows and Linux, Google publishes the Platform Tools as a standalone zip on the official page.
A detail that causes trouble: if you have adb twice (Android Studio’s and Homebrew’s, for example) and they’re different versions, you’ll see messages like adb server version (41) doesn't match this client (39); killing... every time a tool uses one copy and you use the other. which -a adb tells you how many you have on your PATH. Keep one.
Connecting a phone
The phone doesn’t accept adb connections by default. You have to turn it on:
- In Settings > About phone, tap Build number seven times (on Samsung it’s inside Software information). That unlocks Developer options.
- In Settings > System > Developer options (some brands show it directly in Settings), turn on USB debugging.
- Plug in the cable and accept the dialog that appears on the phone with your computer’s RSA key fingerprint.

Then:
adb devicesList of devices attached
R58M12ABCDE device
emulator-5554 deviceIf the second column says unauthorized, you didn’t accept the dialog (unplug and plug it back in). If it says offline, restart the server. If nothing shows up, try another cable: many USB cables only charge and don’t carry data. On Windows, many phones also need the manufacturer’s USB driver (or the Google USB Driver, for Pixels).
With more than one device connected, every command needs to know which one it’s for. That’s what -s with the serial from the list is for:
adb -s emulator-5554 install app.apkWithout a cable
Since Android 11 you can debug over Wi-Fi without going through USB first. In Developer options, turn on Wireless debugging and choose Pair device with pairing code. The phone shows you an IP, a port and a code:
adb pair 192.168.1.42:37123 # asks for the code
adb connect 192.168.1.42:41567 # the port on the main Wireless debugging screenCareful: the pairing port and the connection port are different. The first one appears in the code dialog; the second, on the Wireless debugging screen. The computer and the phone have to be on the same network.
The commands that handle day-to-day work
Install and uninstall
adb install app.apk # installs
adb install -r app.apk # reinstalls keeping the data
adb uninstall com.example.app
adb shell pm clear com.example.app # wipes data and cache, like a fresh installpm clear is handy for testing onboarding or the first sign-in without uninstalling.
Read logs
adb logcatWithout filters, logcat is an unreadable waterfall from the whole system. What helps is filtering by your app’s process:
adb logcat --pid=$(adb shell pidof -s com.example.app)Or by level, to see only errors:
adb logcat '*:E'adb logcat -c clears the buffer before you reproduce a bug, so what you see afterwards is only what happened in that attempt.
Let the phone see your localhost
This is the one people search for the most. You have an API running on localhost:3000 on your computer and the app on the phone can’t find it, because to the phone localhost is the phone itself.
adb reverse tcp:3000 tcp:3000From then on, localhost:3000 inside the phone points to your computer. It works over USB and over wireless debugging, and it saves you from swapping the API URL for your network IP. adb reverse --list shows the ones you have active and adb reverse --remove-all removes them.
In the Android Studio emulator there’s also the special address 10.0.2.2, which points to your computer’s localhost without needing reverse.
Open a deep link
adb shell am start -a android.intent.action.VIEW -d "myapp://order/123"It’s the fastest way to check that a link opens the right screen without having to message it to yourself and tap it.
Screenshots and video
adb exec-out screencap -p > screenshot.png
adb shell screenrecord /sdcard/demo.mp4 # Ctrl+C to stop
adb pull /sdcard/demo.mp4screenrecord has a three-minute limit per recording.
Move files
adb push config.json /sdcard/Download/
adb pull /sdcard/Download/report.pdf .A shell inside the phone
adb shellIt’s a Linux shell with Android’s restrictions. From there, or directly with adb shell <command>, there are shortcuts that save time while testing:
adb shell cmd uimode night yes # dark mode
adb shell input text "email@example.com" # types into the focused field
adb shell wm size 1080x1920 # simulates another resolution
adb shell wm size resetinput text is especially handy so you don’t type long passwords on the phone’s keyboard every time you test a login.
When you don’t need it
adb is a low-level tool, and in many workflows someone else is already using it for you.
With Expo Go you don’t touch it. You scan the QR code from npx expo start and the phone connects over the network. There’s no USB debugging or adb devices involved. When you move to npx expo run:android or the React Native CLI, those tools do use adb, but they install the app and set up the reverse for Metro’s port on their own.
Android Studio does it from the UI. Logcat has its own panel with filters, the Device Explorer replaces push and pull, and in the emulator you can drag an APK onto the window to install it.
To debug a website on the phone, Chrome is enough. You open chrome://inspect on the computer, connect the phone with USB debugging on, and you get the full DevTools for whatever tab is open in Chrome on the phone. You don’t need to install the Platform Tools. And if you just want to see your site on the phone, serve your dev server on the network (--host in Vite or Astro) and open your computer’s IP.
For one-off things, the phone is enough. Installing an APK someone sent you is done by downloading the file and opening it. A screenshot is taken with the buttons. adb starts to pay off when you do the same thing many times or when you need something the UI doesn’t give you (logs, deep links, clean data in a second).
It doesn’t apply to iOS. adb is Android only. On the Apple side, the equivalent is split between Xcode, xcrun simctl for the simulator and xcrun devicectl for physical devices.
One last precaution
USB debugging gives any authorized computer full access to the phone: installing apps, reading files, seeing logs that can include data from your apps. If it’s your personal phone, turn it off when you’re done. And every so often, in Developer options, use Revoke USB debugging authorizations to forget the computers you gave permission to at some point.
The summary
adb is the client, a server on port 5037 and a daemon on the phone. adb devices to see what’s connected, kill-server when something gets stuck, reverse so the phone sees your localhost, and logcat filtered by your app to read what the screen doesn’t tell you.
And if your workflow is Expo Go, Android Studio or a website open in Chrome, you’re probably already using it without typing it, or you don’t need it at all. It’s fine not to install it until the day you need it.