29

I want to use adb pull to pull a db file from Nexus 7 to PC.

My nexus 7 has been rooted.

If a use "adb pull /data/data/com.xx.xx/databases/xx.db .", it failed because of permission problem. But if I use ">adb shell; >su", but then I can't use "adb pull" command.

nandeesh
  • 24,740
  • 6
  • 69
  • 79
TianxiLiu
  • 367
  • 1
  • 3
  • 8
  • 1
    I don't own a rooted device to check, but my guess is that the ADB Daemon `adbd` process (on the device) has to be running as `root` in order to perform this action. Kill it and start it up with `root` privileges. – soulseekah Nov 26 '12 at 08:04
  • 3
    This is not a programming question, it probably belongs on http://android.stackexchange.com/. Generally, `adb` needs to run with root privileges (insecure mode) for this to work. – Nikolay Elenkov Nov 26 '12 at 08:05
  • 2
    @soulseekah It is not as simple as that, because adbd drops root privileges automatically. This can be controlled by system properties if you are using a custom ROM. Otherwise there is this: http://www.xda-developers.com/android/run-adbd-in-root-mode-with-adbd-insecure/ – Nikolay Elenkov Nov 26 '12 at 08:06
  • 24
    did you try adb root command before doing adb pull? – nandeesh Nov 26 '12 at 08:08
  • 1
    Of course what you run on the host doesn't matter. `adbd` on *the device* needs to run as root. And it will only run as root on an engineering/debug build. On a user build, it will refuse to start as root. If it works, you are probably using a custom ROM, but still starting `adb start-server` as root has nothing to do with that (that only makes it easier to access the USB device your device is connected to). – Nikolay Elenkov Nov 26 '12 at 08:29
  • Thanks everybody. Nikolay Elenkov is right, I tried "adb root" but if failed as I the ROM is production building. "adbd on the device needs to run as root". – TianxiLiu Nov 27 '12 at 02:22
  • 2
    you could copy the file to your SD card and then adb pull – Anno2001 Feb 17 '13 at 12:53
  • 3
    This is a relevant software development question. – Antonio Feb 10 '16 at 16:32

0 Answers0