Reputation: 35090
export PATH="/Users/myname/Library/Android/sdk/platform-tools:$PATH"
adb -s emulator-5554 shell
chmod 777 /data/data/com.me.myproject
chmod 777 /data/data
adb -s emulator-5554 pull /data/data/com.me.myproject
Upvotes: 19
Views: 36272
Reputation: 1
Upvotes: 0
Reputation: 1483
prefixing the remote path with ./ or removing the leading / makes the whole difference for me ??? I guess because the system folder must be relative to root's home?
Darn it, those stupid Linux folks wasted my time again. I admit my whole life is about relative paths but this one got me good. Make sure you use \ for your target file, stupid Bill G. also decided to go backwards with his slashes and that created a whole mess. :)
PS. What's even weirder both files in my examples were pulled (copied) to the BASH shell current folder NOT c:\ That's stupid or what :)
FAILS
adb -s 192.168.1.120:5555 pull /system/media/bootanimation.zip c:\boot1.zip
SUCCEEDS
adb -s 192.168.1.120:5555 pull ./system/media/bootanimation.zip c:\boot1.zip
SUCCEEDS
adb -s 192.168.1.120:5555 pull system/media/bootanimation.zip c:\boot1.zip
Upvotes: -1
Reputation: 845
The reason is the file you wanted to copy needs root permission. It's better to copy the file to /mnt/sdcard/ where you have a right to interact with.
cp <file> /mnt/sdcard/
adb pull /mnt/sdcard/<file>
Upvotes: 2
Reputation: 1841
I had the same problem and I did this:
adb shell
run-as com.yourPackageName
(not rooted device) cp 'database/file_you_want.db' '/sdcard/file_you_want.db'
exit
exit
(now you will be back to main terminal window)adb pull /sdcard/xx.db
Upvotes: 27
Reputation: 3876
That's because your debugging Android device is not rooted.
If you have a physical rooted device or have an emulated device, try executing this before, to restart ADB in root mode. Then any command should work:
adb root
Upvotes: 17