Skip to content

File Operations

Push File

pb push <path> [--dest <dest>]

Push a file to the device. Supports local files and URLs.

ParameterTypeRequiredDescription
pathstringYesLocal file path or HTTP(S) URL
--deststringConditionalDestination path on device

Routing Strategy

Input Type--destBehavior
http:// / https:// URLRequiredDevice downloads the file (via file/download)
Local file pathOptionalChunked upload via shell. Default dest: /sdcard/Download/<filename>
Local file pathEnds with /Original filename is appended to the directory path

WARNING

When pushing a URL, you must provide --dest to specify where the device should save the file.

Examples:

bash
# Push a local file (default destination: /sdcard/Download/photo.jpg)
pb push ./photo.jpg

# Push to a specific location
pb push ./photo.jpg --dest /sdcard/Pictures/photo.jpg

# Push to a directory (preserves filename)
pb push ./photo.jpg --dest /sdcard/Pictures/

# Push a URL (device downloads it)
pb push https://example.com/file.zip --dest /sdcard/Download/file.zip
text
✓ Pushed to /sdcard/Download/photo.jpg (102400 bytes)
json
{
  "code": 200,
  "data": { "path": "/sdcard/Download/photo.jpg", "size": 102400 },
  "msg": "Pushed to /sdcard/Download/photo.jpg (102400 bytes)"
}

Pull File

pb pull <path>

Pull (download) a file from the device to your local machine.

ParameterTypeRequiredDescription
pathstringYesFile path on the device

Example:

bash
pb pull /sdcard/Download/screenshot.png

Shell Command

pb shell <command>

Execute a shell command on the device.

ParameterTypeRequiredDescription
commandstringYesShell command to execute

Examples:

bash
# List packages
pb shell "pm list packages"

# Get device properties
pb shell "getprop ro.build.version.release"

# Check disk usage
pb shell "df -h"
text
package:com.android.chrome
package:com.android.settings
json
{
  "code": 200,
  "data": {
    "output": "package:com.android.chrome\npackage:com.android.settings\n",
    "exit_code": 0
  },
  "msg": "OK"
}

List Files

pb ls <path>

List files on the device.

ParameterTypeRequiredDescription
pathstringYesDirectory path on the device

Example:

bash
pb ls /sdcard/Download/