Bug 278264 - devel/android-tools: 'adb sideload' freezes at "Verifying update package..."
Summary: devel/android-tools: 'adb sideload' freezes at "Verifying update package..."
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Neel Chauhan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-08 19:19 UTC by bsduck
Modified: 2025-11-07 22:52 UTC (History)
11 users (show)

See Also:
bugzilla: maintainer-feedback? (nc)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bsduck 2024-04-08 19:19:30 UTC
Hello,

'adb sideload' doesn't work for me. I've tried a few times to use it to upgrade LineageOS, with two different phones, and every time the same happened:

Running 'adb -d reboot sideload' works as intended, but after that the connection to the phone is lost (it doesn't appear anymore in the output of 'adb devices') and I need to kill the adb process and restart it for the connection to be restored.

Then I run 'adb -d sideload mypackage.zip' and I get the following output:

serving: 'mypackage.zip'  (~0%)

It stays stuck at 0% forever.

On the phone screen, the output is the following:

Supported API: 3
Finding update package...
Verifying update package...

Nothing else after that.

I tried this on 13.2-RELEASE and 14.0-RELEASE, both failed that way. The same procedure works flawlessly on Linux.

I noticed a closed bug report about an issue with USB, which may still be relevant: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264563
Comment 1 Miroslav Lachman 2024-08-18 08:59:51 UTC
(In reply to bsduck from comment #0)
I can confirm the same problem on FreeBSD 13.3-p5 with android-tools-31.0.3p2.0_23
Whenever I try 'adb sideload mypackage.zip" it get stuck on 0%.
Permissins on /dev/usb/X.Y.Z devices are OK, I can see my phone listed by "adb devices" in all stages.

When booted to TWRP

% adb devices
List of devices attached
66********40    recovery

When ADB sideload is activated in TWRP

% adb devices
List of devices attached
66********40    sideload

% adb sideload crDroidAndroid11v728.zip
serving: 'crDroidAndroid11v728.zip'  (~0%)
Comment 2 Yusuf Yaman freebsd_committer freebsd_triage 2024-08-28 16:30:57 UTC
I can't use adb sideload on FreeBSD because of that problem too. I made a workaround: I am using debian guest in bhyve and passthrough usb device (my phone) to the vm and use adb sideload there.
Comment 3 Miroslav Lachman 2024-09-02 08:40:12 UTC
(In reply to Yusuf Yaman from comment #2)
Is there a way to passthrough only one USB port or the whole USB controller must be passthrough?

More detail to this adb bug - the problem is not only with sideload, adb pull has the same problem. adb push of small files worked OK.
I also noticed that if I open 2 konsole windows, run adb pull or adb push of large file and periodically run "adb shell ls" in another window, the progress of data transfer (percentage) jump with each iteration until it is successfully done. But this workaround doesn't work for adb sideload (or maybe the file is too large to see some progress)
Comment 4 Yusuf Yaman freebsd_committer freebsd_triage 2024-09-09 13:43:52 UTC
(In reply to Miroslav Lachman from comment #3)
> Is there a way to passthrough only one USB port or the whole USB controller must be passthrough?


I don't think so, I have passed my whole usb controller through that's located in front of the computer case.

> More detail to this adb bug - the problem is not only with sideload, adb pull has the same problem. adb push of small files worked OK.

Yeah, i can confirm that.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2024-09-17 16:26:28 UTC
For adb push/pull an older version before ports 70cd49992b45 may work better. For example, I use android-tools-adb-9.0.0.r3_4 with my rooted Android 14 phone. USB hotplug can be disabled for extra stability.

  $ cd /usr/ports
  $ git checkout 2e4c1c1b113a~1 devel/android-tools-adb
  $ cd devel/android-tools-adb
  $ sed -i '' 's/NO_\(MAN\)/\1/; /FAKE_LOG/s/$/ -fcommon/' files/Makefile # build fix
  $ sed -i '' 's/__FreeBSD__/__disabled&/' files/patch-adb_client_usb__libusb.cpp # disable hotplug (prefer polling)
  $ pkg delete -x android-tools
  $ make install clean
  $ pkill adb
  $ adb shell

No clue about "adb sideload" (now or 10 years ago). I've always updated custom ROMs from within recovery UI or official via OTA.
Comment 6 Lars Herschke 2024-12-01 12:23:38 UTC
I also have the problem with the sideload. With version 9.0.0_r3 the sideload works, even without the polling patch. From version 29.0.2 the sideload no longer works. Between the versions, the Android Debug Bridge changes from version 1.0.40 to 1.0.41.
Comment 7 Henrich Hartzer 2024-12-31 17:44:20 UTC
I also have this issue. I can reboot the phone with adb, unlock it, flash recovery with fastboot, but sideload does the exact same thing.

Tried it on Mint Linux and it was fine. Not sure if the adb versions were the same or not.
Comment 8 blt 2025-01-01 23:26:07 UTC
Exact same issue with same symptoms on 14.2
Comment 9 Baptiste Daroussin freebsd_committer freebsd_triage 2025-01-09 16:26:24 UTC
I tracked down the issues into libusb, I am not 100% sure yes, but from my testing it seems it to track the bug into lilbusb's libusb_fill_bulk_transfer issue.
Comment 10 Henrich Hartzer 2025-01-09 17:16:43 UTC
Nice find! Is there another issue for that somewhere?

It was interesting how I could use fastboot and get a recovery image going, but not complete a sideload.
Comment 11 tom+fbsdbugzilla 2025-01-23 21:29:22 UTC
I am able to confirm this bug on FreeBSD 14.2-RELEASE amd64
Comment 12 Ivan 2025-05-08 12:04:34 UTC
The same issue. Any fixes?
Comment 13 Miroslav Lachman 2025-05-08 12:25:32 UTC
Is adb version 9 still working with Android 14 or 15? If so, will it be possible to have another port (pkg) with this legacy version, for example devel/android-tools9?
Comment 14 blt 2025-10-13 16:02:36 UTC
Same issue on 14.3
Comment 15 George Mitchell 2025-11-07 20:55:16 UTC
This may or may not be related, but: using FreeBSD 14.3-RELEASE-p5 and android-tools-31.0.3p2.0_40 on a Moto g 5G 2022 with Android 13, "adb pull <file-name>" creates an empty local file with the given name of zero length and never finishes.  Does this sound familiar?  Help!
Comment 16 George Mitchell 2025-11-07 22:52:04 UTC
Please ignore the previous comment -- I sidestepped the problem using adb shell to copy the file I wanted to the /sdcard directory, where it was visible to gmtp.  But it would be nice to be able to "adb pull" and "adb push".