File Operations
Push File
pb push <path> [--dest <dest>]
Push a file to the device. Supports local files and URLs.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Local file path or HTTP(S) URL |
--dest | string | Conditional | Destination path on device |
Routing Strategy
| Input Type | --dest | Behavior |
|---|---|---|
http:// / https:// URL | Required | Device downloads the file (via file/download) |
| Local file path | Optional | Chunked upload via shell. Default dest: /sdcard/Download/<filename> |
| Local file path | Ends 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.ziptext
✓ 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path on the device |
Example:
bash
pb pull /sdcard/Download/screenshot.pngShell Command
pb shell <command>
Execute a shell command on the device.
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | Yes | Shell 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.settingsjson
{
"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.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Directory path on the device |
Example:
bash
pb ls /sdcard/Download/