2

I'm developing my first Android application in Eclipse, Win7x64 and am having trouble pulling a SQLite file to inspect what's getting in it. I'm seeing this problem using DDMS GUI to pull, which seems somewhat known:

[2011-03-01 20:15:51] Failed to pull selection

[2011-03-01 20:15:51] (null)

So I tried the adb command line and while it appears to see the file, it is not to be found on the HD. I've tried multiple syntaxes with front/back slashes in the path and quotes surrounding the filename with no explicit path. I get "374 kb/s (6144 b)" or whatever suggesting a successful pull, but the file is not there.

Community
  • 1
  • 1
333Matt
  • 1,124
  • 2
  • 19
  • 29

5 Answers5

8

Restarting Eclipse fixed this for me (File Menu, Restart option).

Jeff Axelrod
  • 27,676
  • 31
  • 147
  • 246
1

You just need to adb this secuence of steps and commands:

1- Go to the directory where your platform tools resides.

(Mine is: C:\Program Files (x86)\Android\android-sdk\platform-tools)

2- Click Ctrl + Shitt + Mouse right button and select "Open Command Window here"

(This is to open the command promt, you can also open the command promt and type the command: cd C:\Program Files (x86)\Android\android-sdk\platform-tools)

3- Once the shell is open, type this commands

adb shell
su
chmod 777 /data /data/data 
chmod 777  /data/data/package_name_of_your_android_project
chmod 777  /data/data/package_name_of_your_android_project/databases

If you typed that, now you can see the databases, and if you click the pull button in the DDMS, then the error arises. But what you need to do is to type this last command:

chmod 777  /data/data/package_name_of_your_android_project/databases/your_database_name

So, these are the full sequence of commands:

adb shell
su
chmod 777 /data /data/data 
chmod 777  /data/data/package_name_of_your_android_project
chmod 777  /data/data/package_name_of_your_android_project/databases 
chmod 777  /data/data/package_name_of_your_android_project/databases/your_database_name
Sterling Diaz
  • 3,789
  • 2
  • 31
  • 35
1

Are you trying to pull from /data/data/your.application.name? Are you on a production phone? If so, you may be out of luck; production phones disallow access to that directory.

Are you specifying both the source and destination names?

adb pull /sdcard/name.of.file.db name.of.file.db

adb insists on the destination name being a filename, not a directory; in particular, . to mean 'put the file in the CWD' won't work.

Other than that, dunno. Your report does sound a bit peculiar.

You may find it useful to try creating an AVD (an emulated device) and deploying to that. AVDs are not production devices and as such you can do things that real phones won't let you, like tinkering in your application's private data area. If this is a permissions problem this will work round it.

David Given
  • 13,277
  • 9
  • 76
  • 123
  • Well, reboot the stupid computer and the GUI pull works. I am curious, though, if you don't put a path name on the command line pull, does it just write it to the directory you're executing adb.exe from or ??? – 333Matt Mar 02 '11 at 20:14
  • Nope, it moans at you. adb may be one of the best mobile development tools I've ever come across (try, e.g., Symbian one day), but could still be improved... – David Given Mar 02 '11 at 21:50
  • The question's very title makes it clear that the issue is being experienced on an **emulator** not a production phone. – Chris Stratton Apr 08 '14 at 13:46
0

If you run the emulator on a VirtualBox, the problem could be permissions. So, change the permissions from within the running emulator with Alt+F1 and

chmod 775 myfile.db
davidcesarino
  • 16,160
  • 16
  • 68
  • 109
ACV
  • 9,964
  • 5
  • 76
  • 81
0

A reboot fixed the problem with using the DDMS pull via GUI.

333Matt
  • 1,124
  • 2
  • 19
  • 29