androidubuntuadbapp-startup

Android app stuck at "Launching on Devices" or 'device 'DEVICEID' not found' error


The app can not be launched. It is stuck for a very long time in "Launching on Devices" (it seems to not stop).

Sometimes instead of beeing stuck it gives the error

'device 'DEVICEID' not found' error on device serial #DEVICEID executing service 'host-serial:DEVICEID:features'

after some time.

Also the dialog that asks for permission on the device sometimes does only appear after the error already happend (but not always).

The app is not started.

This log might be related to the long startup (it detects it).

2024-07-16 19:14:11,930 [  97057]   WARN - #com.android.ddmlib - TimeoutException getting properties for device RZCTB0V5AWP
java.lang.Throwable: TimeoutException getting properties for device DEVICEID
    at com.android.ddmlib.PropertyFetcher.handleException(PropertyFetcher.java:259)
    at com.android.ddmlib.PropertyFetcher.access$600(PropertyFetcher.java:31)
    at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:213)
Caused by: com.android.ddmlib.TimeoutException
    at com.android.ddmlib.AdbHelper.read(AdbHelper.java:882)
    at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:351)
    at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$18(DeviceImpl.java:795)
    at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1801)
    at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:755)
    at com.android.ddmlib.internal.DeviceImpl.lambda$executeRemoteCommand$15(DeviceImpl.java:618)
    at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1801)
    at com.android.ddmlib.internal.DeviceImpl.executeRemoteCommand(DeviceImpl.java:615)
    at com.android.ddmlib.internal.DeviceImpl.lambda$executeShellCommand$13(DeviceImpl.java:557)
    at com.android.ddmlib.internal.DeviceImpl.logRun1(DeviceImpl.java:1801)
    at com.android.ddmlib.internal.DeviceImpl.executeShellCommand(DeviceImpl.java:554)
    at com.android.ddmlib.PropertyFetcher$1.run(PropertyFetcher.java:209)

I was trying to troubleshot some other issue and now it does not even start. Previously it was working on a different commit but know not even there.

The OS of the host is Ubuntu 24.04. The phone is running Android 14 (One UI 6.1).


Solution

  • I had this problem since updating to Android Studio Koala. Probably due to the adb USB backend default being changed from native to libusb.

    ref. https://developer.android.com/tools/adb#backends

    The default behavior varies among OS. Starting with ADB v34, the liubusb backend is used by default on all OS except Windows, where the native backend is used by default.

    Workaround:

    1. Open Settings: Build, Execution, Deployment > Debugger
    2. Select native for the "ADB server USB backend".