In Android development, when you use the command line to manipulate database SQLite, you sometimes encounter problems with sqlite3 not found. This is because your phone does not have the SQLITE3 program installed. The solution is as follows (two ways to combine to explain more clearly!!!) ):
Method 1:
Sqlite3 not found solution (RPM)
In the development of Android, I was small white, started not long. The recent use of SQLite local cache data, I want to like MySQL through the command line to view the established tables and data in the table, so with the ADB shell entered, typed Sqlite3, prompting Sqlite3:not found. Online Search, the article is a lot of online, but if the direct copy of their orders, found still error, so he studied the following, summarized as follows, hope to meet the same problem friends less detours:
1. Need to get root access to the phone, the method is many, I use 3,601 key root, and sometimes with a key Baidu root
2. From other mobile phone copy sqlite3 file to PC, I was copied from the simulator, for the convenience of everyone, accessories have, you can directly download ha
3. Enter the phone to create a temporary directory
Start---cmd---adb shell---mkdir/mnt/sdcard/tmp, and then exit to CMD
ADB push d:/temp/sqlite3/mnt/sdcard/tmp
4. copy file to/system/xbin
ADB shell
SU (This step report permission denied the word is root did not succeed, re-root it)
Cp/mnt/sdcard/tmp/sqlite3/system/xbin/sqlite3 (Note: This step may be reported in two types of errors, the first: CP not found, change the command to Cat/mnt/sdcard/tmp/sqlite3 >/ System/xbin/sqlite3, the second type: Read-only file system, stating that/system is read-only and needs to be re-mount, read-write, and then continue copying)
The re-mount method is as follows:
Mount (from the Mount data listed on the screen, locate the/system mount information, separated by spaces, the first column represents the device name, the second column represents the directory, the third column represents the file system, and the fourth column represents the permission. Other tutorials on the Web The command is listed directly in this step, because the device name and file system are not the same, so the execution is unsuccessful.
The Mount command is: Mount-o remount,rw-t third column information The first column of information/system
For example, pay attention to the place where the circle is red:
After the mount succeeds, the file copy procedure above is executed, and then it can be copied to the/system/xbin directory.
Need to change the permissions of the file, command: chmod 4755/system/xbin/sqlite3
Last run, Sqlite3, find it.
Method 2:
Reason: Sqlite3 is an executable program, under system/xbin/, some ROM does not carry this thing, resulting in no such tool.
Workaround: Copy a sqlite3 in.
Steps:
1) Make/system folder readable and writable
$ adb shell # mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
2) Open another simulator with sqlite3 (/SYSTEM/XBIN/SQLITE3) or a mobile phone, export the sqlite3 and import it into the/system/xbin without the sqlite3 machine. (You can do this with DDMS)
$ adb push sqlite3 /system/xbin
3) Modify the permissions of the Sqlite3
# chmod 4755 /system/xbin/sqlite3
4) Welcome/system as read-only file
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
5) Now you can use the Sqlite3 command.
# sqlite3 /data/data/com.mobisync.android/databases/sync.db SQLite version 3.6.22Enter ".help" for instructions sqlite> .tables android_metadata file sync_status