Last edited: 2023-01-15
Goal: copy all files from an Android device to a Mac computer. This might used while decommissioning a phone before you resell or discard it.
I ended up using
adb. Other methods include Android File Transfer and OpenMTP, but both of those failed to copy all the files.
The following was done with Android 13 (Pixel 6a) and macOS Monterey version 12.6.2 (MacBook Pro M1).
adb using Homebrew:
brew install --cask android-platform-tools
adb can be installed in other ways, this was the easiest for me.
On the smartphone, enable USB debugging by going to About in settings, and touching the build number until Developer mode is enabled.
adb shell tar -chzf /data/local/tmp/sdcard_backup.tar.gz sdcard exit adb pull /data/local/tmp/sdcard_backup.tgz . tar zxvf sdcard_backup.tgz
/data/local/tmp/is a writable directory (my phone was not rooted)
tarwas used instead of a direct
adb pull /sdcard .because the raw pull command stopped as soon as it hit a file that didn't have read permissions for the user.
tarskips those with an error message instead of stopping.