Find and view an iOS Simulator SQLite database
Use simctl to resolve the installed app’s data container, then open its SQLite file. This avoids hardcoding Simulator UUIDs into a Finder path.
Find the app’s data container
Install and launch your app in Simulator so it has created its data. With Xcode’s command-line tools selected, run:
xcrun simctl list devices booted
xcrun simctl get_app_container booted com.example.MyApp data
Replace com.example.MyApp with your bundle identifier. If more than one simulator is booted, replace booted with the device UDID from the first command. Apple demonstrates container lookup in Getting the Most out of Simulator; xcrun simctl help get_app_container documents your installed version.
Find the database file
Use the returned path in Finder’s Go to Folder, or search the container in Terminal:
app_data=$(xcrun simctl get_app_container booted com.example.MyApp data)
find "$app_data" -type f \( -name '*.sqlite' -o -name '*.sqlite3' -o -name '*.db' -o -name '*.store' \)
Database names and locations depend on the app. Files often live under Library/Application Support or Documents, but they may use other extensions. An App Group store lives in a shared group container instead; consult simctl’s help for resolving your group identifier.
Open the main file, read-only
In Petti, choose Open Database and select the SQLite file. Petti starts in read-only mode and lets you inspect tables and rows. This is a manual file-opening workflow; Petti 1 does not automatically discover Simulator apps.
Leave -wal and -shm files next to a live database. For a stable inspection copy, use the app’s backup/export support or a SQLite-aware backup. Refresh Petti to see later committed changes.
Core Data tables are an implementation detail
A Core Data SQLite store is managed by Core Data, not a public SQL schema. Apple’s persistent store documentation cautions against manipulating these stores directly. For supported inspection and changes, use Core Data APIs and your app’s debugging tools. Do not edit internal tables or assume their names and relationships are stable.
For a custom SQLite store, read-only inspection can help diagnose test data. Avoid editing an active simulator app’s database behind the application’s back.