Inspecting SQLite Databases in Appcelerator Titanium Projects

If you’re using SQLite for your project and you’d like to query the database directly. For Android based devices or emulators, you can do the following:

You’ll need to remember your database name, if you’re using commonJS, you can do something similar to:

Next, find out what devices you have connected using adb:

This will return a list similar to this:

Next, use the ADB shell command to boot into the device:

This will drop you into a shell on the device. Next, find the database file. In the first code snippet here, you can see our database name is app.db, so we’ll use a combination of find and grep to find the file on the device:

And this will return the SQLite file and it’s journal, like this:

Now you can use the CLI tool to open the database, like so:

And you’ll be dropped into the CLI tool. You can get a list of tables by using .tables and exit the program via .quit.

The reference for this post came from this wonderful blog post.

Fix: Titanium & GenyMotion Player Not Found

In the recent update of GenyMotion (Android Emulator) there’s a change which breaks its compatibility with Titanium Studio. You’ll need to open Terminal and create a symlink to fix it, start by opening Terminal and running:

and then type:

Shut Titanium Studio and GenyMotion both down and then restart Titanium Studio and it should work as usual after that point.