shell into android sqlite database console

When you run your android project in android studio on a device or device simulator, and your project saves data in a sqlite database. You can shell into device and then shell into the sqlite shell to perform queries against the sqlite database you have for your android project. Given that you have android sdk installed and your android project is running correctly. The following steps apply for Mac users, should be almost the same as for linux users. For windows users, as long as you’ve shelled into the device, everything is the same.

1. Make sure your sdk binaries are included in the path. To include it, you can add these in the ~/.bash_profile

export ANDROID_HOME=/Users/rick/Library/Android/sdk/platform-tools

2. Shell into the device.

adb shell

3. Go to the sqlite database folder, where com.example.rick.icontact is the package name of your android project.

cd /data/data/com.example.rick.icontact/databases

4. Assume your database name is contacts, shell into your sqlite database by.

sqlite3 contacts

5. sqlite3 basic commands

select * from contacts;

6. Go to your application’s root folder

run-as com.domain.yourapp

Search within Codexpedia

Custom Search

Search the entire web

Custom Search