π¦ data_tree β Flutter Storage Inspector (CLI)
data_tree is a powerful command-line tool that lets you instantly inspect Flutter local storage (GetStorage, SharedPreferences, SQLite, and app Files) directly from your Android device/emulator.
It prints clean ASCII trees (similar to Linux "tree") so you can debug your appβs local data without writing UI code or printing logs.
data_tree does EVERYTHING with one command:
data-tree
============================ β¨ Features
π Automatic Debug App Detection
- Detects Flutter debug apps using
run-as - Shows an interactive package selector
- No --package needed
- Never selects wrong system apps
π Supports Multiple Storage Types
| Storage Type | Support | Details |
|---|---|---|
| SharedPreferences | YES | Parses XML β JSON |
| GetStorage | YES | Reads JSON files under /files |
| Files (/files) | YES | Reads JSON, text, logs, nested dirs |
| app_flutter | YES | Reads plugin storage files |
| SQLite Databases | YES | Lists DB files |
| Hive | Planned | Will decode boxes |
| SecureStorage | No | OS-encrypted |
============================ π³ ASCII Tree Output Example
SharedPreferences Example:
βββ SharedPreferences βββ auth β βββ login: true β βββ token: "ABC123" β βββ user_id: "89" βββ settings βββ theme: "dark" βββ notifications: true
Files Example:
βββ Files βββ config.json β βββ api_url: "https://example.com" β βββ mode: "debug" βββ flutter_callback_cache.json β βββ callbackId: 153 β βββ lastEvent: tap βββ notes.txt: "Temporary note"
SQLite Example:
βββ Databases βββ app.db β βββ
============================ π¦ Installation
Install globally:
dart pub global activate data_tree
Add to PATH:
macOS/Linux: export PATH="$PATH:$HOME/.pub-cache/bin"
Windows: setx PATH "%PATH%;%USERPROFILE%.pub-cache\bin"
Check installation:
data-tree --help
============================ π§ͺ How To Use (Step-by-Step)
STEP 1 β Run your Flutter app (debug mode):
flutter run
STEP 2 β In a NEW terminal:
data-tree
STEP 3 β Select your app:
Detected Debug Apps:
- com.example.myapp
- com.example.myapp2
Select app: 2
STEP 4 β Select storage section:
=== STORAGE DETECTED ===
- SharedPreferences
- Files
- Databases
- AppFlutter
- All
Select storage: 1
STEP 5 β View ASCII Tree Output
============================ π₯ Quick Commands
Print ALL storage:
data-tree All
Only SharedPreferences:
data-tree SharedPreferences
Only Files:
data-tree Files
Search for a key:
data-tree token
============================ π¨ Color Output (NEW)
Color output helps readability:
- Blue = keys
- Green = values
- Yellow = branches
Enable color mode:
data-tree --color
============================ π Troubleshooting
β βNo debug apps foundβ Your app is NOT installed as debug. Fix: flutter run
β βrun-as: unknown packageβ Your app is a release build. Fix: flutter build apk --debug adb install -r app-debug.apk
β βNo readable storage foundβ
- App not running
- Selected wrong package
- Device locked
- No storage created yet
============================ π Why this tool exists
Flutter developers often need to check:
- Login tokens
- User session data
- Saved preferences
- Cached API JSON
- Files saved inside "/files"
- Data saved in app_flutter
- SQLite databases
Normally you must: β Create debug UI β Add print logs β Browse device file explorer β Manually decode JSON or XML β Pull files using ADB
============================ π Security Notes
- Only reads YOUR installed debug apps
- Cannot read other apps
- Cannot access encrypted SecureStorage
- Read-only (never modifies anything)
============================ π License
MIT License β Free to use.
Nikul Prajapati
============================ β€οΈ Summary
data_tree gives instant access to Flutter app storage:
β No logs needed
β No UI debugging
β No ADB pulling
β No file explorer
β No XML/JSON manual parsing
Just:
data-tree
β¦and explore your entire app storage as a readable tree.
============================ π Want More Features?
Available on request:
- Color output (full ANSI)
- SQLite table viewer
- Hive decoder
- JSON export
- DevTools extension
- VS Code extension
- Flutter Desktop UI viewer
Just ask!