6

I searched a lot in DDMS all folders but can not find the location of my package folder in file manager. I have search it into the storage/sdcard0 but there also my package is not present.

enter image description here

take a look I uploaded photo. Is there any special setting from mobile ? My phone android version 4.4.2

please help me to find.

UPDATE

I gone through this steps.

And I reach to My database folder .Now What to do.

adb shell
run-as com.mypackage
ls
cd databases
ls

Now After this what to do.

enter image description here

Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80

6 Answers6

3

As you are looking for the database. I used to copy the database file to any other location after updating it. ( in my code) Then I use any sqlite viewer over phone or over PC to view it.

2

I Think you need a rooted device as far as I know the files on sdcard/Android/data are not the primary files for the packages, those are only extra files (most probably not critical and large files) which are saved on the external storage which is the sdcard.

main package files are saved on the internal storage.

I think you can try this link http://developer.android.com/guide/topics/data/install-location.html you can change the location of app installation.

Br,

2

You can't see the files in DDMS, but you can get a list of the location of all the files using the command:

adb shell pm list packages -f

(you can also add an optional extra parameter to restrict the files listed to be those that match your extra parameter).

Once you have the location of the file, you can then issue a command like

adb pull /system/app/GoogleEarth.apk

to actually get the file off the device and on to your PC.

None of this requires a rooted device.

zmarties
  • 4,809
  • 22
  • 39
2

Since you're looking for the database of your application: Unfortunately there's no way to access the /data/data/your.package.name/databases through DDMS on an unrooted device, as Hussein Ali pointed out correctly. (By the way: The app-data (shared prefs, databases) will reside there no matter of the install-location)

Something like this won't work neither because of Permission denied.

adb pull /data/data/your.package.name/databases/db.sl3

Luckily ICS (Android 4.0) introducted the ability to backup your application-data. That's a possible way to copy your database from your unrooted device to your PC. Please see this post on StackOverflow in order to see what you need to do.

Community
  • 1
  • 1
reVerse
  • 35,075
  • 22
  • 89
  • 84
1

copy the database file to your SD card so you'll be able to use adb pull and get the database to your PC (You can't pull files from private folders such as /data/data/...).

I recommend using SQLite Expert to browse the DB on your desktop: http://www.sqliteexpert.com/

Also, If you still want to use sqlite3 on your device, check out this answer: https://stackoverflow.com/a/7878236/624109

Community
  • 1
  • 1
Muzikant
  • 8,070
  • 5
  • 54
  • 88
  • But what about other data like filesd and shared_pref. – Shabbir Dhangot Sep 04 '14 at 08:10
  • What about them? `shared_prefs` is a folder that contains xml files with your shared preferences and `files` contains your internal/private files of the app (Which by looking at the screenshot provided in the question, you have none). Read more on files at the following links http://developer.android.com/reference/android/content/Context.html#getFilesDir() http://developer.android.com/reference/android/content/Context.html#openFileInput(java.lang.String) http://developer.android.com/reference/android/content/Context.html#openFileOutput(java.lang.String, int) – Muzikant Sep 04 '14 at 08:16
1

phone storage is treated as external storage in location "sdcard" where you havn't saved anything so nothing(package named folder) is created... your package will be in app's "private storage" that's in root "data/data/pkg_name" folder accessible only on rooted device.

Arnav M.
  • 2,590
  • 1
  • 27
  • 44