16

When I read documentation such as examining SQLite 3 databases from a remote shell I get the impression an SQLite command-line binary should exist on my phone. Sadly I can't seem to find it on my phone (but I'm running a custom ROM).

I've read a few other posts that either allude to the existence of such a binary or mention how it is only available in the emulator, but there is nothing definitive.

Is such a binary available anywhere?

Other references:

4
  • 1
    I suppose you could try pulling it from another ROM (or the emulator) and putting it on your device, but I have no idea if that would work or just crash. CM6, for instance, has the sqlite3 binary. Jan 22, 2011 at 2:59
  • on my Samsung Spica -- using Samdroid mod -- I can just type sqlite3 in terminal emulator or adb shell.
    – Lie Ryan
    Jan 22, 2011 at 3:15
  • 2
    Is this a dev question? Jan 22, 2011 at 12:48
  • 2
    @Matthew - nope
    – fostandy
    Jan 23, 2011 at 19:47

9 Answers 9

7

Your best bet would be to use ADB and pull it off the emulator, or pull it from another ROM. You will then have to put it on your device, but you will have to have root to put it in the directory with the other binaries.

sqlite3 does not come on most of the devices. I think it only comes on the developer phones, like ADP1/ADP2, and Nexus One/Nexus S. I know it is not on the Samsung Galaxy S devices such as the Vibrant (I am guessing it's on the Nexus S).

4

As other posts have mentioned, the sqlite3 binary is typically used via ADB from your PC.

If all you want to do is manage SQLite DBs locally, then I've found the free app aSQLiteManager very useful. In addition to a simple GUI for managing and viewing data, it allows running of arbitrary queries.

3

I have put together some build scripts to compile SQLite for Android Native Code using the Android NDK. It builds the SQLite CLI in two versions: Statically and Dynamically Linked, as well as it's Static and Shared Libraries. You may get the scripts from my GitHub and build the binaries yourself:

https://github.com/stockrt/sqlite3-android

Hope this will be useful for someone.

2

SuperOneClick actually has a copy of the binary. It lives in the Dependencies folder, and according to one poster on Stack Overflow, it works when pushed onto your device (I assume it must work on most devices since SuperOneClick uses it).

0

Pulling it off of the emulator won't work.

I found a 1.6 binary here. That page details information on porting, so if the 1.6 binary doesn't work, you can try porting/compiling a new version.

0

tech128 from XDA Forum provides compiled sqlite3 binary for Android.

As of current writing,

Here's SQLite 3.8.11.1 combined into a single source file (the amalgamation) for ARM v6 and v7.

These binaries are built with optimized armv6 and armv7 flags.

Should work on Android 2.x and up.

I have attached 2 versions to this thread, compressed and uncompressed. I had to change the extension to .xap otherwise I can't upload it. Just remove the extension.

Just download and run the uncompressed file, whereas compressed you have to decompress it first.

Compressed

Uncompressed

Source code: https://github.com/tech128/sqlite3

I have tested the armv7-pie (PIE needed for Lollipop) on my Nexus 5 running Android 5.1.1 Lollipop, and it worked.

0

I found a binary that worked on github https://github.com/tech128/sqlite3 relevant xda-developers thread https://forum.xda-developers.com/showthread.php?t=2730422

0

You can install Termux and install sqlite3 via the built-in apt (front end of the built-in dpkg).

-1

A little complicated process I will suggest, because I am not aware of other ways :) , get the Android source code , compile it , in the output directory you will get sqlite3 binary , then push it to your phone's /system/bin/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .