SQLite database for Android real-computer operation via ADB shell

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.