Pages

Tuesday, November 19, 2013

How to import the Sqlite Database of the Android Application from the Real Android Device / Emulator


1. Most of the times , android developers want to see the values written to sqlite in the Android Device so that they can easily debug for the Errors
2. Following is the format for importing the sqlite from the command line
a. First we have to navigate to the Android-Sdk Folder in the command prompt , than the user should navigate to the platform tools


b.  Than we need to type the following command to fetch the sqlite database
adb -d shell "run-as --packagename cat /data/data/--packagename /databases/--sqlitename > /sdcard//--sqlitename"
where the
i.  --packageName stands for the PackageName specified in the Android Manifest File
ii. --sqlitename stands for the Sqlite Name used in the Application
c. The  following is the sample format
adb -d shell "run-as com.ormlite.contact cat /data/data/com.contact/databases/cont.sqlite > /sdcard/cont.sqlite"


No comments:

Post a Comment