Android Debug Real-computer SQLite database

Source: Internet
Author: User
Tags sqlite database

The most recent things to do, first in the simulator database test, read and write operations, found that there is no problem after the test to start the real machine. However, to be able to see changes in the database at the time of testing, ensure that the values of the program are correctly written to the database. The phone is connected via the ADB shell to view it. But the discovery and simulator are different, there are a variety of problems, but summed up a sentence is--- authority is not enough .

Now summarize the question as follows, and give me some of the solutions, are some stupid method. More rough.

  Problem one: sh:sqlite3 command not found.

After the ADB shell enters the program directory through the sqlite3 "databases name", after prompting this, is because/system/xbin/under the sqlite3 file command execution file. The solution is to copy one in. There are also a lot of things online about this. But there are a lot of people who say it's not good. The reason is that there are many versions of Sqlite3, and the personal recommendation is to first figure out the Android version of your real machine. Create a new version of the emulator in the AVD, then pull the/system/xbin/sqlite3 out of the simulator and put it in the real machine.

 Question two: Permission denied

Then the above steps we found that the file was put in, but the file's properties are read-write, no execute permission. So the solution is to give it permission to execute. The simple and brutal way is chmod 777. Simple and rude. In fact, in the above or here we will find a problem, when we use the ADB shell to operate the real machine, we will find that because the phone's system is read only, so the above and our next most of the operation will be rejected or not enough, then we need to temporarily change the file system to writable (I am not very familiar with Linux, this is a solution collected on the Internet).

  Mount-o remount,rw-t Yaffs2/system/xbin

  Question three: cannot LINK executable

After modifying the executable permissions of the Sqlite3 file, the execution fails because the Libncurses.so library file is missing, the internet is down and then pulled into the/system/lib.

  Question four: error:unable to open Database "* * * *": Unable to open database file

Finish the above things, have been tossing for half a day, really is very silent. I thought I was about to settle. Suddenly there was this problem. This question makes me a little puzzled, because Baidu has discovered, this still is the authority question. But what I don't understand is that as a database file, having read and write permissions can still not be sqlite3 loaded. When I try to assign execute permissions to the database, I can open a personal feeling that a file does not need to be executed, and that it does not require permission to be opened by another program. I also hope that you see and let me know after the sound. Although solved but still inexplicable.

After solving the above problem, we can debug the database of the real machine through the ADB shell. There are also some posts on the web, this article is just a collection of supplementary notes and personal encounters with problems.

Android Debug Real-computer SQLite database

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.