Screen & UI
Screenshot
pb screencap
Take a screenshot of the device screen. The image is saved locally in JPG format (quality 80).
Screenshots are saved to: .phonebase/screencap/{YYYYMMDD}/{device_code}-{timestamp}.jpg
TIP
In terminals that support inline images (iTerm2, Kitty), a preview is displayed directly in the terminal.
Example:
pb screencap✓ Screenshot saved: .phonebase/screencap/20250115/IDY291LX6WW6RCW-20250115143022.jpg{
"code": 200,
"data": {
"path": ".phonebase/screencap/20250115/IDY291LX6WW6RCW-20250115143022.jpg",
"size": 45678
},
"msg": "Screenshot saved: .phonebase/screencap/20250115/IDY291LX6WW6RCW-20250115143022.jpg"
}UI Dump
pb dump
Dump the full UI hierarchy as indented XML. Useful for understanding the screen structure.
Example:
pb dumpHuman Output (excerpt):
<node class="android.widget.FrameLayout" bounds="[0,0][1080,2400]">
<node class="android.widget.LinearLayout" bounds="[0,0][1080,2400]">
<node class="android.widget.TextView" text="Hello" bounds="[100,200][300,250]" />
</node>
</node>Compact UI Dump
pb dumpc
Dump a compact version of the UI hierarchy. Less verbose than pb dump, focusing on key attributes.
Example:
pb dumpcUI Inspector
pb inspect [device_id] [--text] [--image]
Generate an interactive UI inspection report. Creates an HTML file with a dual-panel view: wireframe diagram and annotated screenshot with clickable hotspots.
| Parameter | Type | Required | Description |
|---|---|---|---|
device_id | string | No | Device ID. Defaults to connected device |
--text | flag | No | Output only the wireframe (skip screenshot annotation) |
--image | flag | No | Output only the annotated screenshot (skip wireframe) |
Output files are saved to: .phonebase/inspect/{YYYYMMDD}/{timestamp}/
The output directory contains:
*-inspect.html-- Interactive HTML inspector (open in browser)*-screenshot.jpg-- Raw screenshot*-layout.xml-- Raw UI hierarchy XML
Example:
pb inspect✓ Inspection complete
inspect: .phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-inspect.html
screenshot: .phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-screenshot.jpg
layout: .phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-layout.xml{
"code": 200,
"data": {
"inspect": ".phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-inspect.html",
"screenshot": ".phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-screenshot.jpg",
"layout": ".phonebase/inspect/20250115/IDY291LX6WW6RCW-20250115143022-layout.xml"
},
"msg": "Inspection complete"
}TIP
Open the -inspect.html file in a browser (Cmd+Click in most terminals) for an interactive view where you can hover over elements to see their properties.
Display Info
pb display
Get the screen resolution and rotation of the device.
Example:
pb displayWidth: 1080 Height: 2400 Rotation: 0{
"code": 200,
"data": {
"width": 1080,
"height": 2400,
"rotation": 0
},
"msg": "OK"
}Clipboard
pb clipboard [text]
Get or set the device clipboard content. Without arguments, returns the current clipboard text. With a text argument, sets the clipboard.
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | No | Text to set. Omit to read the current clipboard |
Examples:
# Get clipboard content
pb clipboard
# Set clipboard content
pb clipboard "Hello World"Open URL
pb browse <url>
Open a URL in the device's browser. Tries browsers in priority order: Via > Via GP > Chrome > system default.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to open |
Example:
pb browse "https://example.com"