Inspect and retrieve files from your running app
Read and export files from approved iOS app directories to investigate logs, caches, and other local data.
FileSystem tools help you inspect the files behind a problem and retrieve them for closer analysis. Start with read-only access to approved directories; enable file changes only when a local debugging workflow needs them.
Install
Published pod: AnsightToolsFileSystem.
SwiftPM:
.product(name: "AnsightToolsFileSystem", package: "ansight-sdk")
CocoaPods:
pod 'AnsightToolsFileSystem'
Register the Suite
import AnsightCore
import AnsightToolsFileSystem
let fileSystem = AnsightFileSystemToolsOptions.createBuilder()
.addRoot(alias: "exports", path: "/path/to/exports")
.build()
try AnsightRuntime.shared.registerFileSystemTools(options: fileSystem)
Registration API
registerFileSystemTools(options:): registers the suite.AnsightFileSystemToolsOptions.createBuilder(): creates a suite options builder.addRoot(alias:path:): exposes an additional approved root.
Specific Concerns
- All access is constrained to approved roots.
- File contents are sensitive even when only read tools are enabled.
files.push_file,files.copy_file, andfiles.move_fileuse.write.files.delete_fileuses.criticaland requires.fullAccess.files.begin_binary_downloadstreams bytes over the binary transfer channel.
Tool Matrix
| Name | Id | Policy | Description |
|---|---|---|---|
List Directory | files.list_directory | Read | Lists files and folders inside approved roots. |
Read File | files.read_file | Read | Reads a constrained file. |
Get File Checksum | files.get_file_checksum | Read | Computes file checksums without returning contents. |
Download File | files.download_file | Read | Downloads chunks through JSON fallback. |
Begin Binary Download | files.begin_binary_download | Read | Starts binary WebSocket download for a constrained file. |
Push File | files.push_file | Write | Writes caller-provided content into an approved root. |
Copy File | files.copy_file | Write | Copies a constrained file. |
Move File | files.move_file | Write | Moves or renames a constrained file. |
Delete File | files.delete_file | Critical | Deletes a constrained file. |
Tool Details
Use read tools for directory listing, content inspection, checksums, and downloads. Use write tools for app-sandbox repair workflows. Use delete only when the workflow explicitly depends on removing files.