Device File Management

Get file information from the device

Returns metadata about a specific file or directory on the device storage, including its path, size, and whether it is a directory.

post/sessions/{sessionId}/device/statFile

Request

Path parameters

sessionIdstring required

The id of the device session

Request body

pathstring required

The absolute path of the file or directory on the device to get information about.

bundleIdstring

The iOS app bundle identifier (e.g., com.example.app). Required for iOS devices, not needed for Android. On iOS, each app runs in its own sandbox — an isolated file system container that restricts access to only that app's data. This means you must specify which app's sandbox to operate on by providing its bundle ID. You can find the bundle ID in Xcode, in the app's Info.plist, or via the Sauce Labs app management API. See Apple's File System documentation for more details.

Example request

{
  "path": "/Download/report.txt",
  "bundleId": "com.example.app"
}

Response

File information retrieved successfully

pathstring

The absolute path of the file or directory on the device.

sizeinteger

The size of the file in bytes. 0 for directories.

isDirectoryboolean

Whether the path is a directory.

Example response

{
  "path": "/Download/report.txt",
  "size": 1024
}

Changes

No recorded changes to this operation across all 1 revision of this API.