Adding Storage Inspection to the Debug Panel
ProWhat you'll learn
- Generating the storage inspector sub-brick for
app_debugger - What directories are surfaced on Android vs iOS
- Sharing files directly from the debug panel
- Stripping the inspector from release builds
Prerequisites
app_debuggerbrick already installed (see App Debugger Setup)
Step 1: Generate the Brick
archipelago generate app_debugger_storageNo variables are required.
Step 2: Understand the Generated Packages
infrastructure/
├── app_debugger_storage_api/ # Inspector contract
│ └── lib/src/
│ └── storage_inspector_sdk.dart
├── app_debugger_storage/ # Debug tab implementation
│ └── lib/src/
│ ├── storage_inspector_sdk_impl.dart
│ ├── walker/directory_walker.dart
│ └── di/storage_inspector_module.dart
└── app_debugger_storage_noop/ # Release no-op
└── lib/src/
└── storage_inspector_sdk_noop.dartThe impl adds two debug-only dependencies to your shell app's pubspec.yaml:
# Added automatically — debug impl only
dependencies:
share_plus: ^11.0.0
path_provider: ^2.1.5No manual AndroidManifest.xml edits are needed. The FileProvider authority is auto-merged by the brick's manifest patch.
Step 3: Configure build_prepare
# build_prepare.yaml
flavors:
debug:
app_debugger_storage:
dependency: app_debugger_storage
release:
app_debugger_storage:
dependency: app_debugger_storage_noopStep 4: Verify in Debug Mode
Run the app and open the debug panel. You should see a Storage tab.
Android — full directory walk
The following directories are surfaced:
| Directory | Description |
|---|---|
| APK | Installed APK path |
| FILES | getFilesDir() |
| DATABASES | SQLite databases |
| SHARED_PREFS | SharedPreferences XML files |
| CODE_CACHE | Compiled code cache |
| Internal cache | getCacheDir() |
| External cache | getExternalCacheDir() |
| External files | getExternalFilesDir() |
| OBB | Opaque binary blobs |
Tap any file to share it directly from the panel using share_plus. This is useful for pulling database files off a physical device without ADB.
iOS — sandbox-limited
Due to iOS sandbox restrictions, only the app bundle size is available. A banner in the panel explains this limitation. Directory-level inspection requires a macOS build or Instruments.
Step 5: Share a File for Inspection
On Android, tap any file row in the Storage tab and choose Share. The system sheet appears and you can AirDrop, email, or save the file to your machine.
This is particularly useful for inspecting the live SQLite database:
- Open Storage tab → DATABASES
- Tap the
.dbfile - Share to your Mac and open with DB Browser for SQLite
Next Steps
- Set up App Debugger if you haven't already
- Size Analyzer to track binary size over time