Inspect and retrieve files from your running app

Read and export files from approved Android 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 artifact: ai.ansight:ansight-tools-filesystem-android.

dependencies {
    debugImplementation("ai.ansight:ansight-tools-filesystem-android:1.6.3")
}

Register the Suite

import ai.ansight.runtime.AnsightOptions
import ai.ansight.tools.filesystem.withFileSystemTools

val options = AnsightOptions.createBuilder()
    .withFileSystemTools {
        addRoot("exports", application.filesDir.resolve("exports"))
    }
    .withReadOnlyToolAccess()
    .build()

Registration API

  • withFileSystemTools(...): registers the suite.
  • AndroidFileSystemToolsOptions.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, and files.move_file use Write.
  • files.delete_file uses Critical and requires withAllToolAccess().
  • files.begin_binary_download streams bytes over the binary transfer channel.

Tool Matrix

NameIdPolicyDescription
List Directoryfiles.list_directoryReadLists files and folders inside approved roots.
Read Filefiles.read_fileReadReads a constrained file.
Get File Checksumfiles.get_file_checksumReadComputes file checksums without returning contents.
Download Filefiles.download_fileReadDownloads chunks through JSON fallback.
Begin Binary Downloadfiles.begin_binary_downloadReadStarts binary WebSocket download for a constrained file.
Push Filefiles.push_fileWriteWrites caller-provided content into an approved root.
Copy Filefiles.copy_fileWriteCopies a constrained file.
Move Filefiles.move_fileWriteMoves or renames a constrained file.
Delete Filefiles.delete_fileCriticalDeletes a constrained file.

Tool Details

Use read tools for inspection and download. Enable write and critical tools only for specific local repair workflows.