Error «Waiting for all target devices to come online» in Android Studio is one of the most common problems that developers face when trying to run an application on a physical device device or emulator. The message appears in the build logs (Run/Debug) and blocks further execution, leaving the project in limbo. In most cases, the reason lies not in the application code, but in the development environment settings, device drivers or configuration ADB (Android Debug Bridge).

In this article we will analyze all possible reasons errors - from trivial (disabled USB debugger) to rare (version conflicts ADB or damaged configuration files). You'll receive step-by-step guide for each scenario, as well as prevention tips to ensure the problem doesn't happen again. We will pay special attention to the nuances of working with Windows, macOS i Linux, since solution algorithms may differ.

1. Checking device connectivity: basic steps

Before diving into complex settings, make sure that the problem is not related to the physical connection or settings of the device. Get started with these steps:

  • 🔌 USB cable and port: Use the original cable from the device (cheap analogues may not support data transfer). Try a different port on your computer - some USB 3.0 ports conflict with ADB.
  • 📱 Debugging mode: On the device, go to Settings → About phone → Build number (press 7 times to activate developer mode), then enable USB debugging v Settings → System → For developers.
  • 🖥️ Debugging permission: When you first connect to a PC, the device will appear request Allow USB debugging? —be sure to confirm it and check the box Always allow from this computer.

If the device is connected, but Android Studio does not see it, check the status in the terminal:

adb devices

The response should include your device with status device. If there is no status or indicated unauthorized, then the problem is in permissions or drivers.

📊 What OS do you use for development?
Windows
macOS
Linux
Other

2. Restarting the ADB server: a universal solution

In 70% of cases, the error is solved by restarting ADB server. This resets all current connections and often resolves temporary glitches. Run the commands in the terminal Android Studio (Terminal in the bottom panel) or system console:

adb kill-server

adb start-server

If after restarting the device is still not detected, try force reset:

adb kill-server

adb -a -d nodaemon server start

After that, check the list of devices again (adb devices). If the status has changed to offline, disconnect and reconnect the device.

💡

On Windows before restarting ADB close all apps using port 5037 (for example, Genymotion or BlueStacks). Port conflict is a common cause of error.

3. Updating device drivers (for Windows)

On Windows the problem is often associated with missing or outdated drivers for ADB. Even if the device is detected as a media player, special drivers are required for debugging.

Download the latest versions from official sources:

  • 🔧 Universal drivers: Google USB Driver (for devices Nexus/Pixel and most brands).
  • 📱 Manufacturers: To Samsung, Xiaomi, Huawei download drivers from their websites (for example, Samsung USB Driver for Mobile Phones).

Install drivers manually via Device Manager:

  1. Connect the device to the PC.
  2. Open Device Manager (Win + X → Device Manager).
  3. Find the device in the section Portable devices or Other devices (may be displayed as ADB Interface with an exclamation mark).
  4. Right-click → Update driverSearch for drivers on this computer → specify the path to the downloaded drivers.
What to do if the driver is not installed?

If the system displays the error "Best drivers found", try removing the device from the Manager, disabling driver digital signature verification (via gpedit.msc → User Configuration → Administrative Templates → System → Driver Installation) and repeat the installation.

4. Conflicts with other apps and ports

Some applications block the port 5037, which uses ADB. These include:

  • 🖥️ Emulators: BlueStacks, NoxPlayer, Genymotion.
  • 🔄 Device managers: Samsung Smart Switch, Xiaomi Mi PC Suite.
  • 🛡️ Antiviruses: Avast, Kaspersky (can block adb.exe as suspicious file).

Solutions:

  1. Close all emulators and device managers.
  2. Add adb.exe (located in Android/sdk/platform-tools) to antivirus exceptions.
  3. Check the port occupancy with the command:
    netstat -ano | findstr 5037

    If the port is busy, find the process by PID and end it through Task Manager.

Also, a conflict can arise when several devices are connected at the same time. Try turning off everything except the target one.

5. Problems with the Android emulator

If an error occurs when running on emulatorcheck:

  • 🖥️ Emulator version: Update Android Emulator via SDK Manager v Android Studio.
  • 🔧 AVD Settings: Make sure that the correct architecture is selected in the emulator configuration (x86_64 or ARM) and version Androidcompatible with your application.
  • 🚀 Acceleration: Enable Hardware Acceleration (in BIOS activate VT-x/AMD-V, in the emulator settings select Hardware - GLES 2.0).

If the emulator freezes on loading:

  1. Delete the current one AVD and create a new one with different parameters.
  2. Try to start the emulator from the command line with the flag -wipe-data:
    emulator -avd YourAVDName -wipe-data
  3. Check whether the firewall is blocking the emulator's network access (it uses port 5554 and higher).

☑️ Diagnostics of the emulator

Done: 0 / 5

6. Damaged configuration files and cache

Sometimes the error is associated with damaged files Android Studio or Gradle. Try the following:

  • 🗑️ Clear cache:
    1. Close Android Studio.
    2. Delete folders:
      ~/.android (Linux/macOS)
      

      C:\Users\YourName\.android (Windows)

    3. Also clear the cache Gradle:
      ./gradlew clean
  • 🔄 Reset settings: In Android Studio go to File → Manage IDE Settings → Restore Default Settings.
  • 📦 Reinstalling SDK Tools: Open SDK Manager, delete and install again Android SDK Platform-Tools i Android Emulator.
  • Critical information: If after clearing the cache the device is no longer detected at all, check the file adbkey in the folder .android. Removing it will reset all key pairs ADBand the device will need to reconfirm debugging.

    7. Problems with specific devices (Xiaomi, Huawei, Samsung)

    Some manufacturers add additional layers of protection that interfere ADB. Let's consider the features of popular brands:

    Brand Problem Solution
    Xiaomi Blocking ADB default Enable USB Debugging (Security Settings) in Developer Options and disable MIUI Optimization.
    Huawei Unlock required OEM Activate OEM Unlock in Developer Options and get the unlock code on the website Huawei.
    Samsung Conflict with Samsung Smart Switch Close Smart Switch or delete it. Use original drivers Samsung USB Driver.
    OnePlus Error unauthorized after update Revoke permissions ADB to Developer OptionsRevoke USB Debugging Authorizations and reconnect the device.

    For devices Xiaomi and Huawei may be required unlocking the bootloadereven if you do not plan to install custom firmware. Look for instructions on the official forums of manufacturers.

    💡

    On devices with MIUI (Xiaomi), permissions are often reset after a system update. ADB. Always check the debugging settings after updates.

    FAQ: Frequently asked questions about the “Waiting for Target Devices” error

    Why is the device detected as offline in adb devices?

    Status offline means that ADB has detected the device, but cannot communicate with it. Reasons:

    • Outdated version ADB (update via SDK Manager).
    • Conflict with other ADBservers (for example, from emulators).
    • Problems with USB connection (try a different cable/port).
    • Solution: restart ADB with the flag -a -d nodaemon server start or reinstall the drivers.

    Is it possible to run the application without a physical device?

    Yes, use Android Emulator or cloud services:

    • Android Studio Emulator (included in the SDK).
    • Genymotion (paid, but with a free trial version).
    • Firebase Test Lab (testing on real devices in the cloud).
    • For the emulator make sure the project has the correct launch target selected (appEdit Configurations).

    Why is the device no longer detected after updating Android Studio?

    Updating the studio may reset the paths to SDK or update ADB to an incompatible version. Check:

    1. Path to SDK v File → Project Structure → SDK Location.
    2. Version ADB:
      adb version

      If the version is lower 1.0.41update Platform-Tools.

    How to fix the error on macOS/Linux?

    On Unix systems the problem is often related to device permissions. Run:

    1. Add a rule for udev (Linux):
      echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"' | sudo tee /etc/udev/rules.d/51-android.rules

      (replace 18d1 with idVendor your device found through lsusb).

    2. Reboot the service. security udev:
      sudo udevadm control --reload-rules
      

      sudo udevadm trigger

    3. On macOS check if it is blocking Gatekeeper launch adb (permit in System Settings → Protection and Security).
    What to do if nothing helps?

    If all methods have been exhausted:

    • Try another device or emulator to check.
    • Create a new project in Android Studio and try to run it - this will help determine whether the problem is related to the project or environment.
    • Check the logs Android Studio (Help → Show Log in Explorer) for errors related to ADB or Gradle.
    • Contact Stack Overflow with a detailed description of the problem (specify version Android Studio, OS, device model and error log).

    If the error «Waiting for all target devices to come online» repeats regularly, it is worth considering alternative debugging methods: using Wi-Fi ADB (wireless debugging), cloud devices or even a physical device with an unlocked bootloader for more stable operation. In most cases, the problem is solved by a combination of restarting ADB, updating drivers and checking for conflicts with other software.

    💡

    For a long-term solution, configure Wi-Fi ADB: after the USB connection, do adb tcpip 5555then unplug the cable and connect via IP (adb connect 192.168.x.x). This will eliminate problems with the USB connection.