google / adb-sync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adb-sync fails whenever directory contains a very large file.

YesButWhyThough opened this issue · comments

Whenever I attempt to sync a very large file to my android, the program will return an error. However, if I just adb push it, then the transfer will go through flawlessly. This problem does not arise with smaller files which are less than 1.5G.

OS: Fedora 26/ Linux.
Phone: Galaxy S4

Steps to replicate:

  1. Have a very large file, in this case `~/Documents/ToPhone/Day2.mp4', 6.4G in size.
  2. Attempt to sync the directory containing this file ./adb-sync --delete ~/Documents/ToPhone/ /mnt/extSdCard/fromComputer.

The file will first appear to be transferring correctly, with the progress indicator getting close to 100%.. Eventually, the transfer will result in an error message:

Sync: local /home/mikey/Documents/ToPhone, remote /mnt/extSdCard/fromComputer
Scanning and diffing...
Push: /mnt/extSdCard/fromComputer/Day2.mp4
adb: error: failed to copy '/home/mikey/Documents/ToPhone/Day2.mp4' to '/mnt/extSdCard/fromComputer/Day2.mp4': no response: Success
Interrupted-Push-Delete: /mnt/extSdCard/fromComputer/Day2.mp4
error: no devices/emulators found
Total: 0 KB/s (0 bytes in 1157.919s)
Traceback (most recent call last):
  File "/home/mikey/GoogleDrive/ScriptsThatIMightUse/requirements/adb-sync", line 774, in <module>
    main(*sys.argv)
  File "/home/mikey/GoogleDrive/ScriptsThatIMightUse/requirements/adb-sync", line 769, in main
    syncer.PerformCopies()
  File "/home/mikey/GoogleDrive/ScriptsThatIMightUse/requirements/adb-sync", line 585, in PerformCopies
    self.num_bytes += s.st_size
  File "/home/mikey/GoogleDrive/ScriptsThatIMightUse/requirements/adb-sync", line 474, in __exit__
    fs.unlink(name)
  File "/home/mikey/GoogleDrive/ScriptsThatIMightUse/requirements/adb-sync", line 254, in unlink
    raise OSError('unlink failed')
OSError: unlink failed`
  1. Attempt to transfer the file by just using adb adb push Day1.mp4 /mnt/extSdCard/fromComputer. This operation will complete successfully.

adb: error: failed to copy '/home/mikey/Documents/ToPhone/Day2.mp4' to '/mnt/extSdCard/fromComputer/Day2.mp4': no response: Success

That's an error by adb - not much we can do there.

(BTW, I actually suspect the file is transferred completely and adb just reports an error at the end - still nothing we can do about that here)