Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jleonelpm/ea44d5849c4965f2006894c4d624d2ae to your computer and use it in GitHub Desktop.
Save jleonelpm/ea44d5849c4965f2006894c4d624d2ae to your computer and use it in GitHub Desktop.
Connect to Sqlite3 via Android ADB Shell

Connect to Sqlite3 via ADB Shell

Enter the command adb devices to get the list of your devices: ~/Android/Sdk/platform-tools/adb devices

Connect a shell to your device: ~/Android/Sdk/platform-tools/adb -s emulator-5584 shell

Navigate to the folder containing your db file: cd data/data/<your-package-name>/databases/

Type su if you ran into any permisson issue; just type su to gain root access

Run sqlite3 to connect to your db: sqlite3 vidura.db

SQLite cheatsheet

There are a few steps to see the tables in an SQLite database:

  • List the tables in your database: .tables
  • List how the table looks: .schema tablename
  • Print the entire table: SELECT * FROM tablename;
  • List all of the available SQLite prompt commands: .help

reference: http://stackoverflow.com/questions/28220636/view-sqlite-database-on-device-in-android-studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment