Verify what your app stores on the device
Inspect SQLite schemas and run read-only queries in your Cordova/Capacitor app to investigate missing or unexpected data.
Database tools let you check the records behind an app’s behavior, such as whether a value was saved or expected records are present. Discover SQLite databases, inspect their schemas, and run constrained read-only queries inside approved app roots.
const options = Ansight.createOptionsBuilder()
.withDatabaseTools({
includePlatformRoots: true,
})
.withReadOnlyToolAccess()
.build();
The suite exposes data.list_databases, data.describe_schema, and constrained read-only data.query. Platform roots cover the standard app directories. Add additionalRoots only when you need an existing database directory outside those defaults; these are native device paths, not WebView URLs or paths on your development machine. Keep roots narrow and treat returned rows as sensitive.
Run a read-only query
After connecting the app, list its SQLite files with the connected session ID:
ansight app call <session-id> data.list_databases --arguments '{}'
If you need to find the session or inspect the available database tools, use:
ansight session list --connected --json
ansight app tools <session-id> --id-prefix data. --detail full --json
Replace <session-id> with the connected session ID and use a returned database entry in the next calls. If the list is empty, first open the app feature that creates its database or configure its actual directory in additionalRoots.
On Android, copy the entry’s rootAlias and relativePath into root and path:
ansight app call <session-id> data.describe_schema \
--arguments '{"root":"<rootAlias>","path":"<relativePath>"}' --json
ansight app call <session-id> data.query \
--arguments '{"root":"<rootAlias>","path":"<relativePath>","sql":"SELECT name FROM sqlite_master ORDER BY name","limit":5}' --json
On iOS, copy the entry’s absolute path and use maxRows:
ansight app call <session-id> data.describe_schema \
--arguments '{"path":"<path-from-list>"}' --json
ansight app call <session-id> data.query \
--arguments '{"path":"<path-from-list>","sql":"SELECT name FROM sqlite_master ORDER BY name","maxRows":5}' --json
The query returns up to five database object names. For a database containing a notes table, a returned row might be {"name":"notes"}. In the tool result, Android places rows under query.rows; iOS places them under rows and also returns columns. These are platform-specific result shapes, so use the live catalog as the argument and result reference. Once this succeeds, use the schema to choose the table and columns whose saved values you want to check.
See calling app tools from the CLI for argument-file support and other call options.