2

I'm using adb in an automated setup for testing. The following commands, whenever I execute them, sporadically return an exit code of 1 with no indication of errors happening:

  • adb shell settings put global bluetooth_disabled_profiles 1
  • adb shell am force-stop [my app id]
  • adb shell am start -n [my app id]/[app activity id]
  • adb forward --remove tcp:8000
    • interestingly, adding port forwarding using adb forward tcp:8000 tcp:5050 always returns exit code 0
  • adb forward --list
  • adb devices -l

The exit code of the commands listed above is 0 more than 95% of the time it is executed. In the other 1%…5% of executions, adb returns an exit code of 1 but stderr is empty. In all these cases, the command worked fine, i.e. it seems like adb should always return 0.

I wonder why the exit code is non-zero. Should I get some additional info? Or is this a bug in adb? Is this a known issue?

Software info: I've tried different recent versions of adb on Windows 10, e.g.:

adb --version
Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
1
  • maybe connection/speed issue. you can check logcat or try linux and check dmesg but I guess the only way to figure out is monitoring serial traffic. does it happen on adb over tcpip too?
    – alecxs
    May 12, 2022 at 17:34

1 Answer 1

0

I've had problems with adb push failing for no obvious reason.

It proved to be a problem with the USB-C socket the device was connected to; try a different one?

1
  • 1
    Thanks for the hint, but I'm seeing this issue on a few different computers, Google Pixel smartphones and USB cables, so it does not seem to depend on hardware (alone). Jun 7, 2023 at 13:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .