rd22
rd22

Reputation: 1032

Android Device manager : "transfer error: Permission denied"

I am trying to pull my applications databases files, I can see that I have all the permissions in the database file "-rwxrwxrwx", which I provided by chmod -r 777 /data/data/com.example.myapp, but I am not able to, I constantly get the above error when I try to pull it and moreover the device manager keeps crashing.

The error that I get:

[2015-07-19 19:48:44 - ddms] transfer error: Permission denied

[2015-07-19 19:48:44] Failed to pull selection: Permission denied

I am using Android Studio, my device has root access and I am on a mac.

This is what I am trying to pull:

enter image description here

Edit: When I run the following command I get this error Package 'com.example.hackbot' has corrupt installation :

run-as com.example.hackbot chmod /data/data/com.example.hackbot/databases/HackBotDB

Any help is valuable.

Cheers

Upvotes: 9

Views: 14215

Answers (3)

kandroidj
kandroidj

Reputation: 13932

this is easy to do:

  1. plug in your device, and run adb shell from command line or terminal
  2. Once in the shell run-as com.myapplication.packagname
  3. then cd into the databases folder cd databases
  4. Then run cat my_datbase_name.db > /sdcard/my_database_name_temp.db
  5. run exit and then exit again to get back to the normal terminal prompt
  6. run adb pull /sdcard/my_database_name_temp.db and that should be it

You can donwload sqlitebrowser to view this data

Upvotes: 13

karthik
karthik

Reputation: 1

  1. Run the app using android emulator then goto->tools->android device monitor dialog will opened go to File Explorer ->data folder (give permission to data folder)
    • open cmd using start menu
    • go to sdk folder (e.g., C:\Users\android-sdks\platform-tools>)
    • type adb shell
    • su
    • chmod 777 /data
    • chmod 777 /data/data/in.co.gesardisplays.www.rwfiles/files/gesar.txt changes will be affected in adb monitor
  2. Pull the files to folder
    • exit from the shell
    • follow previous step 1.2
    • type adb root
    • adb pull /data/data/in.co.gesardisplays.www.rwfiles/files/ or select ur file click a pull a file icon it will be at top right of file explorer

Upvotes: -1

Mimmo Grottoli
Mimmo Grottoli

Reputation: 5773

The adb shell linux user and your app linux user are different. So, for security reason, you can't get private app data from adb, but you can make a copy as you did. I agree, it's messy and unclean but it's been designed that way. So my suggestion is to add Stetho to your app. You can monitor your DB from Chrome, as well as getting other debug infos.

Upvotes: 4

Related Questions