Debug Tools
How to inspect app storage in the Flutter debug panel
Pro Reference for app_debugger_storage: every variable, option and package it generates. Command: archipelago generate app_debugger_storage
Generate the storage inspector for app_debugger, read the breakdown on Android and iOS, export it as JSON, and strip it from production flavors.
What you'll learn
- Generating the storage inspector sub-brick for
app_debugger - Reading the storage breakdown on Android and iOS
- Exporting the breakdown as JSON
- Stripping the inspector from production-flavor builds
Prerequisites
app_debuggeralready installed (see App Debugger Setup)
Step 1: Generate the Brick
archipelago generate app_debugger_storageThe brick has no variables.
Step 2: Understand the Generated Packages
features/app_debugger_storage/
├── app_debugger_storage_api/ # StorageInspectorSDK and models
├── app_debugger_storage/ # Debug implementation and Storage tab
│ ├── android/ # Kotlin StorageAnalyzer
│ ├── ios/ # Sandbox-limited stub
│ └── lib/src/
└── app_debugger_storage_noop/ # Production-flavor stubThe debug package depends on share_plus and path_provider. The noop and API packages do not. You do not edit AndroidManifest.xml. share_plus registers its own FileProvider, and the manifest merger combines it.
Step 3: Check build_prepare
The brick adds the swap entry to build_prepare.yaml for you:
build_prepare:
mappings:
- debug: app_debugger_storage
release: app_debugger_storage_noopThe generated Fastfile runs dart run monorepo_toolkit build-prepare --flavor <flavor> before every build. Internal flavors keep the inspector, also in release mode. The production flavor gets the noop.
Step 4: Check the Wiring
The hook adds GetIt.I<StorageInspectorSDK>(); at the archipelago:debug_panel_pages marker in app_debugger's lib/src/di/debug_tools.dart. The SDK is an eager singleton, so the Storage tab appears before the first frame.
Step 5: Verify in an Internal Flavor
Run the app and open the debug panel. Select the Storage tab.
Android
The tab groups storage into four buckets: app bundle, internal data, cache and other. Each bucket lists one level of children:
| Source | Description |
|---|---|
| APK | The installed APK |
filesDir | App files |
| Databases | SQLite databases |
shared_prefs | SharedPreferences files |
| Code cache | Compiled code cache |
| Internal and external cache | Cache directories |
| External files and OBB | External storage |
iOS
The iOS sandbox limits what the app can read. The tab shows only the app bundle size. A note in the panel explains this.
Step 6: Export the Breakdown
Use the export action to write the breakdown as JSON and open the share sheet. From code:
final sdk = getIt<StorageInspectorSDK>();
final breakdown = await sdk.captureBreakdown();
final path = await sdk.exportAsJson();Send the file to your computer to compare builds or share a bug report.
Next Steps
- Set up App Debugger if you have not already
- Size Analyzer to track binary size over time