Repository navigation
1.0.2
What's New
If you have pb installed, run the following to upgrade and verify:
pb update && pb --version
Output
- Smart output — Humans see colored text, tables, and ✓/✗ status. AI agents get structured JSON. Automatic, no config needed
PHONEBASE_OUTPUT— Set tojsonortextto force output format (case-insensitive)- Human-friendly tables —
pb devicesandpb devices listshow a clean table in terminal, JSON when piped - Key-value display —
pb status,pb display,pb top-activityetc. show aligned key-value pairs instead of raw JSON - Boolean results — Commands like
pb startshow✓ Success/✗ Failedinstead oftrue/false - Config dual-mode —
pb config show,pb config list,pb config get,pb apikeynow output JSON when piped
New Commands
pb browse <url>— Open URL in browser, auto-picks best available (Via → Via GP → Chrome → system default)pb uninstall <package>— Uninstall app from devicepb install --uri <url>— Install APK from URL (in addition topb install <file>)pb list— Now an alias command, shows API name + description. Hides aliased and internal APIspb info <name>— Now an alias command, shows API details
Screenshot
- JPG format — Quality 80, much smaller than PNG
- Terminal preview — Screenshot displayed directly in terminal (iTerm2/Kitty)
- Organized storage — Saved to
.phonebase/screencap/{YYYYMMDD}/{device_code}-{timestamp}.jpg - Project data directory —
.phonebase/in working directory for screencap, inspect, and future data
Device Control
pb dumpformatting — XML output is now nicely indented instead of a single long linepb swipeupgrade — Now uses bezier curve scrolling (input/scroll_bezier) for smoother swipes- Alias Handler system — Each alias can have custom logic.
clipboardauto-picks get/set,installauto-picks file/uri
Connection
- Auto-disconnect — Idle connections close after 10 minutes to save costs (configurable:
pb config set network.idle_timeout 600) - Removed user aliases —
~/.phonebase/aliases.tomlno longer supported. All aliases are built-in
Error Handling
- No URL leaks — HTTP errors no longer expose internal API URLs
- Friendly prefixes —
✗ Not found: ...,✗ Unauthorized: ...,✗ Rate limited: ...instead of raw error codes
UI
- Device Code — All user-facing text uses "Device Code" (e.g.
IDY291LX6WW6RCW) instead of "Device ID" devices create— Now shows device_code and status after creationuicommand hidden — Removed from help output (still works)screencapsubcommand removed — Now runs as alias command, same usage
更新内容
运行以下命令升级并验证:
pb update && pb --version
输出
- 智能输出 — 人类看到彩色文字、表格和 ✓/✗ 状态,AI 拿到结构化 JSON。自动切换,无需配置
PHONEBASE_OUTPUT— 设为json或text强制指定输出格式(不区分大小写)- 表格显示 —
pb devices和pb devices list终端显示表格,管道输出 JSON - Key-value 显示 —
pb status、pb display、pb top-activity等显示对齐的键值对,不再是原始 JSON - 布尔值友好 —
pb start等命令显示✓ 成功/✗ 失败而不是true/false - 配置双模 —
pb config show、pb config list、pb config get、pb apikey管道输出 JSON
新增命令
pb browse <url>— 用浏览器打开链接,自动选择最佳浏览器(Via → Via GP → Chrome → 系统默认)pb uninstall <包名>— 卸载应用pb install --uri <链接>— 从 URL 安装 APK(原有pb install <文件>保留)pb list— 改为别名命令,显示接口名+描述,隐藏已有别名和内部接口pb info <名称>— 改为别名命令,显示接口详情
截图
- JPG 格式 — 质量 80,体积远小于 PNG
- 终端内预览 — 截图直接在终端中显示(支持 iTerm2/Kitty)
- 有序归档 — 保存到
.phonebase/screencap/{YYYYMMDD}/{设备编号}-{时间戳}.jpg - 项目数据目录 — 工作目录下
.phonebase/统一存放截图、inspect 等数据
设备控制
pb dump格式化 — XML 输出自动缩进,不再是一行到底pb swipe升级 — 改用贝塞尔曲线滑动(input/scroll_bezier),滑动更顺滑- 别名 Handler — 每个别名可以有自定义逻辑。
clipboard自动选 get/set,install自动选 file/uri
连接
- 自动断开 — 空闲 10 分钟自动断开,避免浪费(可配置:
pb config set network.idle_timeout 600) - 移除用户自定义别名 — 不再支持
~/.phonebase/aliases.toml,所有别名内置
错误处理
- 不泄露地址 — HTTP 错误不再暴露内部 API 地址
- 友好前缀 —
✗ 资源不存在: ...、✗ 认证失败: ...、✗ 请求过于频繁: ...替代原始错误码
界面
- 设备编号 — 所有可见文案统一使用「设备编号」(如
IDY291LX6WW6RCW)替代「设备 ID」 devices create— 创建后显示 device_code 和 statusui命令隐藏 — 从帮助中移除(命令仍可用)screencap子命令移除 — 改为别名命令运行,用法不变
