To access your database via the terminal, make sure that your emulator is running before doing the following:
-
Get a list of your emulators by typing: ~/Library/Android/Sdk/platform-tools/adb devices
-
Connect to the emulator you're running your app on: ~/Library/Android/Sdk/platform-tools/adb -s emulator-**** shell
(replace the **** with the correct number for your device, which you will have seen after running the previous command) You are now navigating the file structure of your emulator.
-
Type the following command to gain root access to the emulator: su
-
Navigate to the folder containing your db file: cd data/data/yourappsname/databases Your app's name will be somethign like com.example.name.app
-
Run sqlite3 to connect to your db: sqlite3 yourdatabasename
Ta Da! You can now type normal SQL queries!