DEV Community

Cover image for A Terminal-First Developer’s Guide to Using ADB Without Android Studio
M Usama Khizar
M Usama Khizar

Posted on

A Terminal-First Developer’s Guide to Using ADB Without Android Studio

As a software engineer, system architect, and someone who has spent years teaching developers how things actually work under the hood — let me say this clearly:

You do not need Android Studio to build, run, or debug Android apps.

If you're building with React Native, Flutter, Ionic, Expo, or pure native Android — and you prefer working from the terminal — this guide is for you.

This is real-world. Clean. Controlled. Professional.

Let’s jump in.


1️⃣ What is ADB? (Explained Like a Human)

ADB (Android Debug Bridge) is the communication layer between your computer and your Android device.

Think of it as a command-line remote control.

With ADB, you can:

  • Install apps
  • Run your app
  • View logs (logcat)
  • Debug crashes
  • Forward ports
  • Push & pull files
  • Execute shell commands
  • Screen record
  • Uninstall apps

It works over:

  • 🔌 USB
  • 📶 Wi-Fi (Wireless Debugging)

No IDE required. Just a terminal.


2️⃣ Install ADB (Minimal Setup — No Android Studio)

You only need Android Platform Tools.

Download from Google:

👉 https://developer.android.com/tools/releases/platform-tools

Extract it somewhere clean like:

C:\platform-tools

Add it to your system PATH (recommended for professionals).

Then verify:

adb version
Enter fullscreen mode Exit fullscreen mode

If you see a version number → ✅ You're ready.

3️⃣ First Time USB Setup (One-Time Process)

Step 1: Enable Developer Options

On your phone:

Settings → About Phone → Tap "Build Number" 7 times

Step 2: Enable USB Debugging
Settings → Developer Options → USB Debugging → ON

Step 3: Plug in USB and run:
adb devices

You should see something like:

List of devices attached
R58R70B1FGJ device

If it says:

unauthorized

Look at your phone → Tap Allow.

Done.

4️⃣ Wireless ADB (Modern Android 11+ Method)

Old method (adb tcpip 5555) is outdated.

Modern Android uses Wireless Debugging with Pairing Code.

Step 1: Enable Wireless Debugging
Settings → Developer Options → Wireless Debugging → ON

Tap:

Pair device with pairing code

You’ll see:

IP Address

Port

Pairing Port

Pairing Code

Example:

IP: 192.168.18.124
Port: 37143
Pairing Port: 37851
Code: 482901

Step 2: Pair from Terminal
adb pair 192.168.18.124:37851

Enter pairing code when prompted.

You should see:

Successfully paired

Step 3: Connect
adb connect 192.168.18.124:37143

Verify:

adb devices

You should see:

192.168.18.124:37143 device

🎉 Fully wireless. No cables.

5️⃣ Fix: "More than one device/emulator"

If you see:

error: more than one device/emulator

You probably have:

USB connected

Wireless connected

Or stale session

Fix 1: Disconnect wireless
adb disconnect 192.168.18.124:37143

Fix 2: Restart ADB cleanly
adb kill-server
adb start-server
adb devices

Fix 3: Target specific device
adb -s 192.168.18.124:37143 logcat

Professional developers always target explicitly when multiple devices exist.

6️⃣ Using ADB with Your Framework

🔹 React Native (CLI)
npx react-native run-android

If multiple devices:

npx react-native run-android --deviceId=192.168.18.124:37143

🔹 Expo

Start:

npx expo start

Press:

a

Or:

npx expo run:android

🔹 Flutter

Check devices:

flutter devices

Run:

flutter run -d 192.168.18.124:37143

🔹 Ionic / Capacitor
ionic cap run android --target=192.168.18.124:37143

7️⃣ Viewing Logs (Your Debugging Superpower)

Logs are where real developers live.

Basic logcat
adb logcat

Clear logs first
adb logcat -c
adb logcat

Only errors
adb logcat *:E

View crashes only

Mac/Linux:

adb logcat | grep FATAL

Windows:

adb logcat | findstr FATAL

Filter by package
adb logcat | grep com.your.app

This is how you diagnose real production issues.

8️⃣ Install APK Manually

Install:

adb install app-release.apk

Replace existing:

adb install -r app-release.apk

This is useful for CI/CD pipelines and staging tests.

9️⃣ Port Forwarding (Critical for Dev Servers)

If using:

React Native Metro

Expo

Local backend

GraphQL server

Express API

Run:

adb reverse tcp:8081 tcp:8081

Now your phone can access:

localhost:8081

This is a must-know skill for serious devs.

🔟 Useful ADB Power Commands

Open shell
adb shell

List installed packages
adb shell pm list packages

Uninstall app
adb uninstall com.your.app

Screen record
adb shell screenrecord /sdcard/demo.mp4

Pull file
adb pull /sdcard/demo.mp4

1️⃣1️⃣ If ADB Stops Working

Run:

adb kill-server
adb start-server

If still broken:

Disable USB debugging

Re-enable

Reconnect device

Sometimes simplicity fixes everything.

1️⃣2️⃣ Professional Best Practices

If you build apps seriously:

✅ Use USB for heavy debugging
✅ Use Wireless for mobility testing
✅ Always target specific device (-s)
✅ Use adb reverse for dev servers
✅ Restart ADB cleanly when confused

Avoid:

❌ Multiple active connections
❌ Random reconnect loops
❌ Ignoring unauthorized warnings

1️⃣3️⃣ Common Problems & Quick Fixes

Problem Fix
device unauthorized Tap Allow on phone
device offline Unplug + adb kill-server
more than one device Use -s or disconnect
adb not recognized Add to PATH
wireless not connecting Ensure same WiFi network
Final Advice (Real Talk for Beginners)

You do NOT need Android Studio to:

Build apps

Install apps

Debug apps

View logs

Run Metro

Run Flutter

All you need is:

ADB

Node or Flutter SDK

USB or WiFi

Android Studio is helpful.
But it is not required.

🎯 The Bigger Engineering Lesson

When you understand tools at the system level:

You gain:

Control

Speed

Confidence

Debugging power

CI/CD flexibility

A true engineer does not depend on a UI.

They understand the bridge underneath.

Welcome to terminal-first Android development.

Top comments (0)