What the 'adb device offline' Error Means
The adb device offline error occurs when Android Debug Bridge (ADB) detects a connected Android device but cannot establish a full-fledged connection for debugging. As a result, the adb devices command displays the device status as offline instead of device.
Typical terminal output:
List of devices attached
0123456789ABCDEF offline
This error blocks the ability to execute any ADB commands (app installation, logs, shell access), rendering the device useless for development or routine operations.
Common Causes
The error arises from a break in the "handshake" between the ADB server on the computer and the ADB daemon on the device. Primary causes include:
- Unconfirmed authorization. When first connecting, a dialog asking "Allow USB debugging?" with a key fingerprint must appear on the device. Tapping "Cancel" or closing the window causes the device to enter
offlinestatus. - Issues with the USB cable or port. A cable that only charges (no data transfer) or a faulty/underpowered USB port.
- Driver conflicts or outdated drivers (Windows). An improperly installed ADB Interface driver or conflict with other software emulating devices (e.g., virtual machines, emulators).
- Firewall or antivirus blocking. Some security programs may block the connection on port 5037, which ADB uses.
- ADB server malfunction. A temporary glitch in the
adb.exe(oradbon Linux/macOS) process requiring a restart. - ADB version mismatch. Rarely, this can happen when using a very old Android SDK Platform-Tools version with a new device (or vice versa).
Solutions
It is recommended to perform the solutions in order from simplest to most complex.
Method 1: Basic Reconnection and Authorization
This is the most frequent fix, resolving a "stuck" authorization session.
- On the Android device, open Settings → Developer options.
- Find and disable "USB debugging".
- Disconnect the USB cable from the computer.
- Re-enable "USB debugging".
- Reconnect the device to the computer.
- Immediately when the dialog "Allow USB debugging?" appears on the phone screen, check "Always allow from this computer" and tap "OK".
- In the terminal, run
adb devices. The device should now show asdevice.
Method 2: Restart the ADB Server
If the issue is not authorization but a server glitch.
- Open a terminal (Command Prompt, PowerShell, bash).
- Execute the command to stop the server:
Output may be empty or contain a termination message.adb kill-server - Immediately start the server again:
You should see the messageadb start-server* daemon started successfully *. - Check the device list:
adb devices. The status should change todevice.
Method 3: Update/Reinstall Drivers (Windows Only)
If the problem occurs only on Windows, it's likely a driver issue.
- On the computer, press
Win + R, typedevmgmt.msc, and press Enter (Device Manager). - Locate your connected device. It may appear under:
- Portable Devices (with a yellow exclamation mark).
- Other devices.
- Android Device (if the driver is partially installed).
- Right-click the device and select "Uninstall device". If a checkbox "Delete the driver software for this device" appears—check it.
- Disconnect and reconnect the phone to the computer.
- Windows will attempt to find a driver automatically. Do not let it do this. Instead:
- In Device Manager, go to Action → Add legacy hardware.
- Click Next, select "Install the hardware that I manually select from a list (Advanced)".
- From the list of hardware types, select "Portable Devices" (or "Android Device").
- Click Next, then "Have Disk".
- Click Browse and point to the folder containing the Google USB Driver. It is typically located at
<sdk>\extras\google\usb_driver\(where<sdk>is your Android SDK path). - Select the file
android_winusb.infand click Open → OK. - From the list, select "Android ADB Interface" and click Next. Accept the warning about the unsigned driver.
- After installation,
adb devicesshould show the device asdevice.
Method 4: Revoke USB Debugging Authorizations on the Device
If the computer has an incorrect key cached or the trust chain failed.
- On the device, go to Settings → Developer options.
- Find and tap "Revoke USB debugging authorizations".
- Confirm the action.
- Re-enable "USB debugging" (if it got turned off).
- Reconnect the device to the computer.
- When the "Allow USB debugging?" dialog appears, confirm it again by checking "Always allow".
Method 5: Check Cable, Port, and USB Mode
Hardware and configuration issues.
- Use a different USB cable. Ensure the cable is original or high-quality and supports data transfer (not just charging).
- Connect to a different physical USB port on the computer, preferably directly on the motherboard (not through a hub).
- On the device, when connected, change the USB mode (the "USB for charging" notification dropdown). Try sequentially:
- "File Transfer" (MTP)
- "PTP" (Photo Transfer)
- "No data transfer", then back to "File Transfer".
- Reboot both devices: first the phone, then the computer.
Prevention
To minimize the chance of the adb device offline error:
- Always confirm the authorization dialog when first connecting a device to a new computer.
- Use a quality USB cable for development, not the one supplied solely for charging.
- Regularly update Android SDK Platform-Tools to the latest stable version via SDK Manager.
- On Windows, after major system updates, reinstall the Google USB Driver.
- If using virtual machines or other software creating virtual ADB devices (Genymotion, BlueStacks), ensure they close properly to avoid blocking port 5037.
Additional Steps (If Nothing Else Worked)
If the problem persists, perform a comprehensive check:
- Ensure ADB sees the device at the system level.
- On Linux/macOS, run
lsusb(Linux) orsystem_profiler SPUSBDataType(macOS). The device should be listed. - On Windows, Device Manager should show no unknowns or devices with errors.
- On Linux/macOS, run
- Check if port 5037 is occupied by another process. Run:
- Windows:
netstat -ano | findstr :5037 - Linux/macOS:
lsof -i :5037If the port is in use, terminate the conflicting process (e.g., another ADB instance, Genymotion, some Android tools).
- Windows:
- Temporarily disable antivirus and firewall for 5 minutes and check
adb devices. If the error disappears—add exceptions for the Android SDK folder andadb.exein your security settings. - Create a new Windows user (or account on macOS/Linux) and try running ADB from that profile. This rules out issues with a corrupted current user profile.
- Update the device's firmware (if possible) or try connecting a different Android device. This helps localize the problem: if the second device works, the issue is with the first (possibly a Developer Options glitch or hardware fault with the micro-USB/USB-C port).