December 22, 2024

I was trying to figure out how to browse the tables in Android. And it seems like the only way to do that on an Android device is to root it. Otherwise you’ll get a permission denied when trying to access the data. But, you can view the tables in the emulator. Here’s how to do it:

– Start up the android emulator
android
– Connect to the emulator shell
adb -e shell
– Get superuser access
su
– Change to the data directories
cd data/data
– Change to a database directory
cd com.android.providers.contacts/databases
– Open up a database
sqlite3 contacts2.db
– List tables
.tables
– Show table structure
.schema contacts
– Display table data
select * from contacts;
– Exit sqlite3
.exit
– Exit shell
exit