Home > Enterprise >  How to download content of /storage/emulated/0/android/data/ with Terminal (OSX)
How to download content of /storage/emulated/0/android/data/ with Terminal (OSX)

Time:09-25

I want to download the content of /storage/emulated/0/android/data/com.xxxx.myapp as zip file to my Mac download folder.

  1. I connect my Android phone with USB to my Mac
  2. I open terminal
  3. I run adb shell
  4. I run cd /storage/emulated/0/android/data

Now, how to zip and download com.xxxx.myapp folder to my Mac download folder?

Or, how to copy com.xxxx.myapp folder to my Mac download folder?

When I run adb shell, the prompt becomes a50:/ $ in Terminal.

If I do cp com.xxxx.myapp /Users/my_user/Downloads I get

cp: Skipped dir '/Users/my_user/Downloads': No such file or directory'.

CodePudding user response:

You can use adb pull.

(Running cp on the phone can't work because your Mac's folders won't exist on the phone. Plus, you forgot -R.)

How to zip: You can create a tarball and save it in /data/local/tmp or some other location you have write access to, by using a regular tar command on the phone:

tar -czf /data/local/tmp/archive.tgz com.xxxx.myapp

Then, exit the ADB shell and run an adb pull command on the host instead:

adb pull /data/local/tmp/archive.tgz ~/Downloads/

You can also just pull the whole folder without compressing it first:

adb pull /storage/emulated/0/android/data/com.xxxx.myapp ~/Downloads/
  • Related