Android Install Sqlite3

Source: Internet
Author: User

Use the Sqlite3 command to view the database Sqlite3 dbname prompt in adb mode:

/system/bin/sh:sqlite3:not found

Originally the Android system does not have the sqlite3 command, so we need to install it ourselves (in fact, just import the Sqlite3 file into the appropriate directory)

On the web, you need to import the Sqlite3 file into your phone's/system/xbin/directory, and then import the libncurses.so library file into the/system/lib/directory

It seems very simple, but it is a waste of my two hours, but also in the process learned a lot of new knowledge. Now the process of going through is simply documented

Steps:

1. Download sqlite3 files and libncurses.so library files

2. Import Sqlite3 and libncurses.so into Android system directory ( emphasis)

I use the Xiaomi phone, although the root authority, but the feeling does not have full permissions.

The simplest way to start thinking is to use the/system/xbin on the SQLite file path on the ADB push PC, with the following prompt:

'/system/xbin/sqlite3 ': Read-only file system

Later Google has Daniel said to encounter this situation, to execute the ADB remount command, and the following prompt:

Remount Failed:operation not permitted

With ADB push this road is unable to get through, had to find other methods. It turns out that Daniel can first use the ADB push command to import the Sqlite3 file into the phone sdcard, and then use the Linux command CP to copy the system folder, the command is as follows:

Cp/mnt/sdcard/sqlite3/system/xbin/sqlite3

At that time felt like discovered the new world, thought finally can solve, the result hints:

/system/bin/sh:cp:not found

I just wonder how many people on the internet said they can use the CP command, how my phone is not there, looked at the next/system/xbin/, the directory does not have a CP file. The original Android command line does not have the CP command, but has the MV command, so executes

Mv/mnt/sdcard/sqlite3/system/xbin/sqlite3
Tip: Failed on '/mnt/sdcard/sqlite3 '-cross-device link

This means that the MV command does not allow the files on the memory card to be copied to the/system/or/data/partition, because the two are considered to be on different devices. Only Google ...

Later, cat commands were found to check cat usage: cat [options] ... [File] ..., the function is to output the [file] or standard input combination to the standard output. Online Daniel: "Occasionally when working with the cat command to display the contents of a text file, and then think of the redirect >, so the combination of the two, it is natural to think that you can by the cat's file output to a specified location to replace the function of CP?" By trying to find out really can. ”

Then try:

Cat/mnt/sdcard/sqlite3 >/system/xbin/sqlite3
Tip:/system/bin/sh:cannot create/system/xbin/sqlite3:read-only File System

I feel hopeful to see this, and cat does have the copy function. Before you see this prompt to solve, first put/system in the Mount state, allow read and write, the command is as follows:

Mount-o remount,rw-t Yaffs2/dev/block/mtdblock3/system

After the cat command is OK, then import the libncurses.so library file into/system/lib/as described above, the complete command is as follows:

Import to SDcard:
ADB push c:\users\user\desktop\download\libncurses.so/mnt/sdcard/libncurses.so
The/system is mounted so that it can read and write:
Mount-o remount,rw-t Yaffs2/dev/block/mtdblock3/system
Copy to System folder:
cat/mnt/sdcard/libncurses.so >/system/lib/libncurses.so

3. Give SQLite permission

After importing the Sqlite3 file and the libncurses.so library file into the appropriate directory, perform the sqlite3 command prompt in adb mode:

/system/bin/sh:sqlite3:cannot Execute-permission denied

No permissions to add, commands are as follows:

chmod 4755 Sqlite3

Verify that Sqlite3 has permissions:

Command: LL Sqlite3
Tip:-rwxr-xr-x root root 36860 2012-08-15 21:45 sqlite3

Then execute the sqlite3 command with the following prompts:

[Email protected]:/# sqlite3sqlite3SQLite version 3.7.4enter '. Help ' for instructionsenter SQL Statements terminated with a ";" sqlite>    

OK, you are done. Thank you to the online Daniel's article guidance

Android Install Sqlite3

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.