Sqlite – Accessing SQLite database in android emulator

android-emulatorsqlite

i am working on an android app which stores data in sqlite db i want to be able to access the data that is currently stored in the emulator. How do i go about connecting to it and perform sql operations.

Best Answer

  • Open a terminal window
  • Get a list of AVD devices by entering: adb devices
  • If your terminal can't find the adb command then have a look at this post for OSX or Windows.
  • Start a shell connection to your AVD by entering: adb -s emulator-xxxx shell
  • Browse to the databases location: cd data/data/your.package.name/databases
  • Type sqlite3 xxxxx.db
  • For SQLite shell instructions see Command Line Shell For SQLite