PC パソコン

How to Fix “adb: device offline” in Android Studio

When using a physical Android device or Android Emulator with Android Studio, ADB may show the device as “offline” and prevent app installation, debugging, and shell commands.

List of devices attached ABC123456789 offline

This means that ADB can detect the Android device or Emulator, but a usable ADB communication session has not been established.

Common causes include a stuck ADB server, unstable USB communication, a non-responsive ADB daemon on the device, multiple ADB installations, or an Emulator that has not finished booting correctly.

This article explains the common causes of “adb: device offline” and practical solutions for both physical devices and Android Emulators.

What Does “adb: device offline” Mean?

ADB, or Android Debug Bridge, is the communication layer used by Android Studio and command-line tools to interact with Android devices.

Check the current device state with:

adb devices

A normal device appears as:

List of devices attached ABC123456789 device

An unhealthy connection may appear as:

List of devices attached ABC123456789 offline

The device has not disappeared completely. ADB knows that it exists, but the connection is not ready to process normal ADB commands.

Important: offline is different from unauthorized. An unauthorized device normally needs RSA debugging approval, while an offline device usually needs the ADB communication session to be restarted or repaired.

Common Causes

1. The ADB Server Is Stuck

This is one of the most common causes.

After long Android Studio sessions or repeated device and Emulator connections, the host-side ADB server can occasionally stop communicating properly with a device.

2. The USB Connection Is Unstable

A damaged cable, unreliable USB port, hub, or adapter can interrupt ADB communication and leave the device in an offline state.

3. The Device-Side ADB Daemon Is Not Responding

Android devices run the adbd daemon to handle ADB communication.

If the device-side service becomes unresponsive, the computer may still detect the device while being unable to communicate with it normally.

4. The Android Emulator Has Not Finished Booting

During Emulator startup, you may temporarily see:

emulator-5554 offline

Once Android and its ADB services finish starting, the state may automatically change to device.

5. The Emulator Is Frozen

If the Emulator is stuck on a boot screen, black screen, or frozen system state, ADB may continue listing it while marking it offline.

6. Multiple ADB Versions Are Running

A computer may have several Android SDKs or development tools containing different ADB binaries.

Mixing versions can cause confusing device-state and connection problems.

7. USB Debugging Is in an Unstable State

Turning USB debugging off and back on can sometimes reset the device-side debugging service and restore normal communication.

8. Wireless Debugging Has Lost Its Connection

With Wi-Fi ADB, network changes, sleep, IP-address changes, or lost pairing information can leave a stale offline connection.

Solution 1: Check the Current Device State

Start with:

adb devices

A physical device may appear as:

List of devices attached ABC123456789 offline

An Emulator may appear as:

List of devices attached emulator-5554 offline

Identify whether the problem affects a physical device, an Emulator, or both.

Solution 2: Restart the ADB Server

This should usually be the first fix you try.

Stop ADB:

adb kill-server

Start it again:

adb start-server

Then check the device:

adb devices

A recovered connection should appear as:

List of devices attached ABC123456789 device

Try this first: If a previously working device suddenly becomes offline, adb kill-server followed by adb start-server is one of the quickest fixes.

Solution 3: Disconnect and Reconnect the USB Cable

For a physical device, disconnect USB and reconnect it.

Keep the Android device unlocked so you can see any debugging or USB-related prompts.

Then run:

adb devices

Check whether the state has changed to device.

Solution 4: Try Another USB Cable

Use a known-good cable that supports data transfer.

Suspect the cable if:

  • The device repeatedly connects and disconnects.
  • It disappears from adb devices intermittently.
  • It switches repeatedly between offline and device.
  • File transfer is also unstable.

Solution 5: Try Another USB Port

The USB port, hub, or adapter may also be responsible.

Try:

  • A different USB port.
  • Connecting directly to the computer.
  • Removing the USB hub.
  • Removing unnecessary adapters.

Solution 6: Turn USB Debugging Off and Back On

Open Developer options on the Android device and temporarily disable USB debugging.

A typical path is:

Settings → System → Developer options → USB debugging

The exact menu varies by manufacturer.

Enable USB debugging again, reconnect the cable, and retry ADB.

Solution 7: Reset USB Debugging Authorization

If authorization also appears unreliable, reset the trusted debugging computers.

In Developer options, choose:

Revoke USB debugging authorizations

Reconnect the device and approve the RSA fingerprint prompt when it appears.

Tip: For a simple offline state, restart ADB and reconnect USB first. Resetting authorization is more useful when the problem continues or authorization behavior also looks incorrect.

Solution 8: Restart the Android Device

If the device-side adbd or USB service is stuck, rebooting the phone or tablet can restore normal communication.

After rebooting:

  1. Unlock the Android device.
  2. Connect USB.
  3. Approve USB debugging if prompted.
  4. Run adb devices.

Solution 9: Restart Android Studio

If ADB works from the terminal but Android Studio still shows the device as offline, restart Android Studio.

You can also reset ADB before reopening the IDE:

adb kill-server adb start-server

Solution 10: Use Cold Boot for an Offline Emulator

If the Android Emulator is offline, use Android Studio’s Device Manager and choose Cold Boot Now for the affected AVD.

A damaged Quick Boot snapshot can sometimes prevent the virtual device from starting cleanly.

Solution 11: Wipe the Emulator Data

If Cold Boot does not help, reset the AVD with Wipe Data.

Warning: Wipe Data removes installed applications, settings, and test data stored inside that virtual device.

After resetting the AVD, start it again and check:

adb devices

Solution 12: Recreate the AVD

If one particular virtual device repeatedly becomes offline, create a new AVD in Device Manager.

If the new AVD appears normally as device, the old virtual-device configuration or stored state was likely the problem.

Solution 13: Let the Emulator Finish Booting

During startup, the Emulator may temporarily appear as:

emulator-5554 offline

After Android finishes starting, it can change to:

emulator-5554 device

If the Android home screen is fully available but ADB remains offline, restart ADB or use Cold Boot.

Solution 14: Check Which adb Binary Is Being Used

If multiple SDKs exist on the computer, Android Studio and your terminal may use different ADB binaries.

On macOS and Linux:

which adb

On Windows:

where adb

Also check the version:

adb version

Make sure an obsolete Android SDK or another development package is not taking precedence in your PATH.

Solution 15: Update Android SDK Platform Tools

Update Android SDK Platform-Tools from Android Studio’s SDK Manager if your ADB installation is old.

After updating:

adb kill-server adb start-server adb devices

Solution 16: Check Windows ADB Drivers

On Windows, unstable USB or ADB drivers can contribute to repeated offline states.

Open Device Manager and inspect entries such as:

  • Android Device
  • Android ADB Interface
  • Portable Devices
  • Other devices

If an ADB interface has a warning icon, reinstall or update the appropriate manufacturer or Google USB driver where applicable.

Solution 17: Change the USB Connection Mode

Changing the device’s USB mode can cause Android to re-establish its USB connection.

From the USB notification, try:

File Transfer / Android Auto

Then run adb devices again.

Solution 18: Reconnect Wireless ADB

If you are using ADB over Wi-Fi, disconnect the stale connection first.

adb disconnect

Or disconnect a specific endpoint:

adb disconnect 192.168.1.100:5555

Then reconnect when the device is correctly configured:

adb connect 192.168.1.100:5555

If you are using Android’s Wireless debugging feature, remove the paired computer from Developer options and pair it again when necessary.

Difference Between “device offline” and “device unauthorized”

ADB can report several different states:

ABC123456 device ABC123456 offline ABC123456 unauthorized

device means that ADB communication is ready.

offline means that ADB sees the device but cannot establish a usable communication session.

unauthorized means that the device is visible but has not approved debugging access from that computer.

Troubleshooting rule: For offline devices, prioritize restarting ADB, reconnecting USB, and rebooting the device or Emulator. For unauthorized devices, prioritize the RSA debugging authorization prompt.

What Happens If You Run Commands While the Device Is Offline?

Commands such as:

adb shell

may fail with:

error: device offline

Application installation can fail as well:

adb install app-debug.apk

Restore the device state to device before continuing normal development work.

If Multiple Devices Are Connected

Only one of several connected devices may be offline.

List of devices attached ABC123456 device XYZ987654 offline emulator-5554 device

You can target a healthy device by specifying its serial number:

adb -s ABC123456 shell

Troubleshoot the offline device separately.

Recommended Steps When a Device Suddenly Goes Offline

If a previously working physical device suddenly changes to offline, try this order:

  1. Run adb devices.
  2. Run adb kill-server.
  3. Run adb start-server.
  4. Reconnect the USB cable.
  5. Unlock the Android device.
  6. Restart the device.
  7. Try another cable and USB port.

Recommended Steps When Only the Emulator Is Offline

If physical devices work but an Emulator remains offline, try:

  1. Make sure the Emulator has finished booting.
  2. Restart the ADB server.
  3. Close and restart the Emulator.
  4. Use Cold Boot Now.
  5. Use Wipe Data.
  6. Create a new AVD if necessary.

Can VPN or Security Software Cause This?

It is less common with USB-connected devices, but network-security software can affect ADB connections in some environments.

VPNs and firewalls are more relevant when using wireless ADB.

If only Wi-Fi ADB becomes offline, test USB ADB as a comparison. This helps determine whether the problem is related to the network or to ADB more generally.

If the Problem Still Occurs

If “adb: device offline” continues, check all of the following:

  • Restart ADB with adb kill-server and adb start-server.
  • Reconnect USB.
  • Try another data-capable USB cable.
  • Try another USB port.
  • Turn USB debugging off and back on.
  • Restart the Android device.
  • Restart Android Studio.
  • Update Android SDK Platform Tools.
  • Check for multiple ADB installations.
  • Check Windows ADB drivers.
  • Use Cold Boot or Wipe Data for an Emulator.
  • Reconnect or re-pair wireless debugging.

Summary

The Android Studio “adb: device offline” problem means that ADB can detect the Android device or Emulator but cannot establish a normal communication session with it.

Start by checking:

adb devices

If the result is:

ABC123456789 offline

restart the ADB server first:

adb kill-server adb start-server adb devices

A practical troubleshooting order is:

  1. Restart the ADB server.
  2. Reconnect USB.
  3. Reset USB debugging if necessary.
  4. Restart the Android device.
  5. Try another cable and USB port.
  6. Update Platform Tools.
  7. Use Cold Boot or Wipe Data for an Emulator.
  8. Reconnect or re-pair wireless ADB.

When communication is restored, adb devices should change from offline to device:

List of devices attached ABC123456789 device

If the problem appears only occasionally, restarting ADB or reconnecting USB is often enough. If it happens repeatedly, investigate the cable, USB port, duplicate ADB installations, Platform Tools version, device drivers, or the state of the affected AVD.