

If your app includes more than one database, select the database to queryįrom the drop-down list on the New Query tab. To query a database follow theseĪt the top of the Databases pane to open a new tab in the inspector You can also use the Database Inspector to run custom SQL queries against yourĪpp's databases while your app is running. Results are displayed in the inspector window. Studio requests values for each parameter before running the query. Select the database to query against from a drop-down list. If your app includes more than one database, Android Studio prompts you to You can run any query method in a DAO by clicking the Run SQLiteīutton next to its annotation. Quickly run query methods that you have already defined in your DAOĪvailable while your app is running and the Database Inspector is open in the

If your app uses Room, Android Studio provides gutter actions that allow you to The tool can use DAO queries if your app uses Room, but it also The Database Inspector can run queries against your app's database while the app Table button at the top of the inspector window. The inspector window becomes read-only and you cannot modify its values.Īlternatively, you can manually update the data by clicking the Refresh While live updates are enabled, the table in

If you want the Database Inspector to automatically update the data it presentsĪs you interact with your running app, check the Live updates checkbox at Next time your app reads the modified data from the database. (such as with LiveData or Flow), then any changes you make to the data are If your app uses Room and your UI observes the database You can modify data in a table by double-clicking a cell, typing a new value,Īnd pressing Enter. The data in the inspector window by that column. Double-click a table name to display itsĭata in the inspector window to the right. The Databases pane displays a list of the databases in your app and the The databases in the currently running app appear in the Databases pane.Įxpand the node for the database that you want to inspect. Select the running app process from the dropdown menu.

Select View > Tool Windows > App Inspection from the menu bar. Note: A known issue related to the Android 11 emulator causes apps toĬrash when connecting to the DB Inspector. Run your app on an emulator or connected device running API To open a database in the Database Inspector, do the following: SQLite libraries that you bundle with your app. Note: The Database Inspector only works with the SQLite library included in theĪndroid operating system on API level 26 and higher. Plain SQLite and with libraries built on top of SQLite, such as This isĮspecially useful for database debugging. Query, and modify your app's databases while your app is running. In Android Studio 4.1 and higher, the Database Inspector allows you to inspect,
