A Swift CLI tool for viewing and exploring IndexStore database contents. This tool helps developers inspect symbols, files, and their relationships within Xcode's IndexStore databases.
- List Symbols: Enumerate all symbols with their USRs (Unified Symbol Resolution) and locations
- Find Symbol: Search for specific symbols by name and display detailed information
- Symbol Details: Show symbol relationships, roles, and providers
git clone <repository-url>
cd isdb-view
swift build -c release
The executable will be available at .build/release/isdb-view
.
The tool provides several subcommands to explore IndexStore databases:
swift run isdb-view list-symbols \
--store-path /path/to/.index-store \
--database-path /path/to/.index-db \
--library-path /path/to/libIndexStore.dylib
swift run isdb-view find-symbol \
--name "MyClassName" \
--store-path /path/to/.index-store \
--database-path /path/to/.index-db \
--library-path /path/to/libIndexStore.dylib
--store-path
(-s
): Path to the IndexStore directory (usually.index-store
)--database-path
(-d
): Path to the IndexStore database directory (usually.index-db
)--library-path
(-l
): Path to the IndexStore library (defaults to Xcode's libIndexStore.dylib)--name
(-n
): Symbol name to search for (required for find-symbol command)
The tool defaults to the standard Xcode installation path:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libIndexStore.dylib
If you have a Swift project with IndexStore enabled:
# Build your project first to generate index data
cd YourSwiftProject
xcodebuild -project YourProject.xcodeproj -scheme YourScheme
# Then analyze the generated index
swift run isdb-view list-symbols \
--store-path ./DerivedData/YourProject/Build/Intermediates.noindex/YourProject.build/Debug/YourTarget.build/Objects-normal/arm64/.index-store \
--database-path ./DerivedData/YourProject/Index.noindex/DataStore
# Or find a specific symbol
swift run isdb-view find-symbol \
--name "MyViewController" \
--store-path ./DerivedData/YourProject/Build/Intermediates.noindex/YourProject.build/Debug/YourTarget.build/Objects-normal/arm64/.index-store \
--database-path ./DerivedData/YourProject/Index.noindex/DataStore
List Symbols:
Enumerating all symbols with USR and file info...
Total symbols found: 1542
Find Symbol:
Opening IndexStore database at: /path/to/.index-db
Successfully opened IndexStore database
Symbol: MyViewController
USR: s:8MyModule16MyViewControllerC
Location: /path/to/MyViewController.swift:15:7
Role: Definition
Provider: Swift
Relation: [related symbol information]
This project depends on:
- IndexStoreDB - Core library for reading IndexStore databases
- Swift Argument Parser - Command-line interface framework
- Swift 6.1 or later
- Xcode (for libIndexStore.dylib)
- macOS (due to IndexStore library requirements)
This project is licensed under the MIT License - see the LICENSE file for details.