Browse SQLite database in Android Studio

Matouš Skála
2 min readOct 7, 2018

--

Have you ever wondered how to debug SQLite database created in the Android app? How to see the schema and the content of the database? Until recently, I used Stetho — a debug bridge for Android applications developed by Facebook, which enables you to debug an Android app using Chrome Dev Tools. Although it's a little inconvenient, it does the job.

Recently, I discovered yet another way. First open Device File Explorer, which is now built-in directly into Android Studio. Then navigate to /data/data/[your.package.name]/databases folder, right-click on your database file and Save As… (The app must be compiled using a debug build variant, otherwise you won't be able to browse its data directory.)

Device File Explorer in Android Studio 3.0

Now you have the SQLite database file and you can open it in a SQLite browser of your choice, e.g. http://sqlitebrowser.org. But If you don't want to leave the IDE, you can install the Database Navigator plugin:

Android Studio— Preferences… — Plugins — Browse Repositories… — Database Navigator — Install

After restarting Android Studio, open DB Browser pane, click + button and add a new SQLite connection by choosing a path to your database file. Then you can easily browse your database schema. To view a table content, double-click on a table name and either specify a query or select No Filter.

Database Navigator plugin

In this way, you can easily see what is happening in the SQLite database on your device or emulator without even having to leave Android Studio. 👏

--

--

Matouš Skála

CTO @ Fitify Workouts 💪 developing Android apps 📱 in Kotlin 💙 and studying Computer Science @ TU Delft 🇳🇱