inspect command prints a hierarchical tree representation of the contents of a Dart kernel (.dill) file. Use it to verify obfuscation results, debug compilation issues, or explore the structure of compiled Dart code.
Usage
Path to the
.dill file to inspect. This is a positional argument (not a flag).Options
Include
dart:* SDK libraries in the output. By default, only user code is shown.Output Format
The inspect command displays a tree structure showing:- Libraries - Top-level modules and packages
- Classes - Type definitions and their members
- Procedures - Functions and methods
- Fields - Class properties and variables
Example Output
Inspecting an obfuscated kernel file:Notice the short, meaningless names (
A, B, C, etc.) - this indicates the rename pass successfully obfuscated the original identifiers.With SDK Libraries
Include Dartβs core libraries in the output:Use Cases
Verify Obfuscation
Check that your code was properly obfuscated:Debug Compilation Issues
If your build fails after obfuscation, inspect the kernel file to identify problematic transformations:Compare Original vs Obfuscated
Generate a non-obfuscated kernel file for comparison:Analyze Third-Party Packages
Inspect any.dill file, including compiled packages:
Tree Structure Reference
The output tree uses these symbols:π¦- Library or packageββ- Last item in a groupββ- Item with siblings belowclass- Type definitionfield- Member variableconstructor- Constructor methodmethod- Instance or static methodprocedure- Top-level function
The tree format is designed for human readability. For programmatic analysis, consider using the Dart kernel API directly.
Technical Details
The inspect command:- Loads the
.dillfile usingFileKernelIO().load() - Parses the kernel component structure with
KernelParser() - Filters out SDK libraries unless
--sdkis specified - Renders a hierarchical tree with
KernelTreePrinter()
Examples
Inspect Build Output
Check Specific Library
Build a kernel file and verify a specific library was obfuscated:Save Output for Analysis
Compare Before and After
Common Issues
Missing Argument Error
If you see:.dill file:
File Not Found
If the.dill file doesnβt exist:
refractor build --target kernel first, or provide the correct path.
Related Commands
refractor build
Generate .dill files to inspect
Understanding Obfuscation
Learn how Refractor transforms your code