Skip to content

Adding Storage Inspection to the Debug Panel

Pro

What 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

Step 1: Generate the Brick

bash
archipelago generate app_debugger_storage

No 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.dart

The impl adds two debug-only dependencies to your shell app's pubspec.yaml:

yaml
# Added automatically — debug impl only
dependencies:
  share_plus: ^11.0.0
  path_provider: ^2.1.5

No manual AndroidManifest.xml edits are needed. The FileProvider authority is auto-merged by the brick's manifest patch.

Step 3: Configure build_prepare

yaml
# build_prepare.yaml
flavors:
  debug:
    app_debugger_storage:
      dependency: app_debugger_storage
  release:
    app_debugger_storage:
      dependency: app_debugger_storage_noop

Step 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:

DirectoryDescription
APKInstalled APK path
FILESgetFilesDir()
DATABASESSQLite databases
SHARED_PREFSSharedPreferences XML files
CODE_CACHECompiled code cache
Internal cachegetCacheDir()
External cachegetExternalCacheDir()
External filesgetExternalFilesDir()
OBBOpaque 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:

  1. Open Storage tab → DATABASES
  2. Tap the .db file
  3. Share to your Mac and open with DB Browser for SQLite

Next Steps

Built by Banua Coder