AppReviewX Log in

adb basics every app tester needs

Install builds, clear data, grant permissions and capture logs with a handful of commands.

In this guide

adb (Android Debug Bridge) is a command-line tool that talks to a phone or emulator over USB or Wi-Fi. You do not need to learn all of it. A dozen commands cover most of what a tester or developer does day to day: install a build, reset the app, set a permission, and save a log for a bug report.

Setup in two minutes

  1. Install the Android SDK Platform-Tools (it contains adb).
  2. On the phone, enable Developer options (tap the build number in Settings > About phone several times), then turn on USB debugging.
  3. Connect the phone and accept the "Allow USB debugging?" prompt.
  4. Run adb devices. Your device should appear as device. If it says unauthorized, accept the prompt on the phone again.

If more than one device is connected, add -s <serial> to every command, using the serial from adb devices.

Install and remove builds

Goal Command
Install an APK adb install app.apk
Update, keep data adb install -r app.apk
Allow a version downgrade (debug builds) adb install -r -d app.apk
Uninstall adb uninstall com.example.app
Uninstall but keep data adb uninstall -k com.example.app

Replace com.example.app with your package name. If an install fails, the error text (for example a signature mismatch or a version-code problem) usually names the cause. A bundle (.aab) is not installed directly; for testing, install the APKs generated from it, or use a store test track.

Reset state

  • adb shell pm clear com.example.app wipes the app's data and cache, like a fresh install without reinstalling. Use it before every first-run test.
  • adb shell am force-stop com.example.app kills the app. Useful for testing cold starts.
  • adb shell monkey -p com.example.app -c android.intent.category.LAUNCHER 1 launches the app without knowing the activity name.

Permissions

  • Grant: adb shell pm grant com.example.app android.permission.CAMERA
  • Revoke: adb shell pm revoke com.example.app android.permission.CAMERA

Granting and revoking is the fast way to test both "allowed" and "denied" paths. Only runtime permissions your app declares can be changed this way.

Logs

  • adb logcat streams the system log. It is noisy; filter by your package or a tag.
  • adb logcat -c clears the buffer first, so your capture starts clean.
  • adb logcat -d > log.txt dumps the current buffer to a file and exits.

A reliable routine for reproducing a bug: clear the log, reproduce the problem once, dump the log, attach it. See also reading crash reports.

Files, screenshots and screen recordings

  • adb pull /sdcard/file.png . copies a file from the phone.
  • adb exec-out screencap -p > screen.png saves a screenshot.
  • adb shell screenrecord /sdcard/demo.mp4 records the screen (stop with Ctrl+C, then pull the file). It stops after a time limit that depends on the device.

Limits

adb tells you what the device did, not what a person felt. It cannot replace testing with real people on real phones, but it makes their reports much better: a log and an exact build are worth more than "it crashed".

Part of the Android app testing guide. Related: Play Console pre-launch report and Android vitals basics.

Want feedback on a build from real people? Start free and get private, structured feedback on your app.