Skip to content

Instantly share code, notes, and snippets.

@muthuraj57
Created April 2, 2019 06:13
Show Gist options
  • Save muthuraj57/ea242cb28bbb89be84e9682820c6b4a5 to your computer and use it in GitHub Desktop.
Save muthuraj57/ea242cb28bbb89be84e9682820c6b4a5 to your computer and use it in GitHub Desktop.
do shell script "/Users/user-name/Library/Android/sdk/platform-tools/adb pull sdcard/Android/data/com.example.test/files/ /Users/user-name/Desktop/"
tell application "Finder" to open POSIX file "/Users/user-name/Desktop/files/sqlite/db_name.db"
@muthuraj57
Copy link
Author

muthuraj57 commented Apr 2, 2019

Database file should be put in external directory for this to work. Below snippet shows how to change database file path only for debug build.

val db by lazy {
            val name = if (BuildConfig.DEBUG) {
                "${appContext.getExternalFilesDir(null).absolutePath}/sqlite/db_name.db"
            } else {
                "db_name.db"
            }
            Room.databaseBuilder(
                appContext,
                YourDatabse::class.java, name
            ).build()
        }

Also sqlite browser should be installed.

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