简体   繁体   中英

sqlite3 Segmentation fault in android adb shell

When I use sqlite3 in adb shell, the error “Segmentation fault”:

shell@android:/data/data/com.yh.web/databases $ ll
ll
-rwxrwxrwx app_106  app_106     12288 2013-09-16 12:33 webview.db
-rwxrwxrwx app_106  app_106     32768 2013-09-16 12:33 webview.db-shm
-rwxrwxrwx app_106  app_106     12608 2013-09-16 12:33 webview.db-wal

shell@android:/data/data/com.yh.web/databases $ sqlite3 webview.db
sqlite3 webview.db
[1] + Stopped (signal)     sqlite3 webview.db

shell@android:/data/data/com.yh.web/databases $

[1] + Segmentation fault   sqlite3 webview.db

The sqlite3 is not exist in my phone at first, I pull it from Android virtual machine, and push it to my phone. solve it by Why do I get a "sqlite3: not found" error on a rooted Nexus One when I try to open a database using the adb shell?

What's wrong and how can i resolve it, please help me, Thanks!

The version of sqlite3 is built based on a particular version of Android. It has to match the version of Android on your phone. You can get more info about sqlite3 in this answer: Version of SQLite used in Android?

Edit:

Assuming you have root access, you can look for an sqlite binary matching your version of Android from the Google Factory images . If that doesn't work, you can do something similar with a matching version of CyanogenMod and extracting the sqlite binary from it. I think Android 4.0.4 matches CM 9.1. You can take a look at http://en.wikipedia.org/wiki/CyanogenMod#Version_history . I think this should be enough to get you started. I don't guarantee that the sqlite binary will work with your phone, though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM