0

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!

Community
  • 1
  • 1
Yhzhtk
  • 174
  • 1
  • 10

1 Answers1

0

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.

Community
  • 1
  • 1
Ehtesh Choudhury
  • 7,452
  • 5
  • 42
  • 48
  • Yes, I find my Android version is 4.0.4 and match SQLite 3.7.4, the link is [SQLite3.7.4](http://www.sqlite.org/changes.html#version_3_7_4), but the [download page](http://www.sqlite.org/download.html) has not sign about android, where can I download the sqlite3 file while can run on my phone? Thanks! – Yhzhtk Sep 17 '13 at 02:05