To manipulate the SQLite database on the Android real computer directly from the command line, you can do it directly through the ADB shell, but only if you have to get root privileges.
In addition, the Android system is actually the Linux shell, this should be known, but under normal circumstances, in the/system/xbin/directory,
There is no sqlite3 command, you need to manually copy one in, normally, two files required
Sqlite3, libncurses.so
Decompression after two files have, such as extract to: ~/downloads/sqlite3/
And then, by following these commands, step-by-step, it's almost done.
# Get root privileges adb rootadb remount #拷贝sqlite3二进制文件到android真机中adb push ~/downloads/sqlite/sqlite3/system /xbin/ #然后改一下这个文件的权限adb shell chmod 4755/system/xbin/sqlite3 #这个时候如果直接运行sqlite3还有问题, You need to copy the libncurses.so to the real machine adb push ~/downloads/sqlite/libncurses.so/system/lib/
OK, complete the above steps, there should be no problem, you can use the following command to enter the Android real machine, and operate the database:
#进入真机adb shell #列出数据库ls-r/data/data/*/databases
Several DB databases that are commonly used in Android
/data/data/com.android.deskclock/databases/alarms.db
/data/data/com.android.providers.contacts/databases/calendar.db
/data/data/com.android.providers.contacts/databases/contacts2.db
/data/data/com.android.providers.settings/databases/settings.db
/data/data/com.android.providers.telephony/databases/mmssms.db
/data/data/com.android.providers.telephony/databases/telephony.db
SQLite database for Android real-computer operation via ADB shell