Skip to content

v1.0.9

Choose a tag to compare

@bittired bittired released this 23 Apr 15:14

What's New

npm install -g phonebase-cli   # first install
pb update && pb --version      # upgrade
  1. pb package info <package> / pb package icon <package> — New two-part subcommands for querying app details and extracting launcher icons. Replaces the old pb icon alias.
  2. pb package info — Returns 404 with a clear error when the package doesn't exist on the device.
  3. pb text — New --clear and --submit flags. --clear clears the input field before typing, --submit presses Enter after. Example: pb text "hello world" --clear --submit.
  4. pb text — Now correctly handles numeric input. Previously, entering a long number like a phone number would garble it into scientific notation.
  5. pb dump / pb dumpc — Now supports format=json parameter to get structured JSON instead of XML/text. Example: pb -j '{"format":"json"}' dump.
  6. pb — JSON output format unified to {code, data, msg, cost} across all commands. Simpler and consistent.
  7. pb — Human-readable output improved: boolean results show localized success/failure marks, data-rich responses show formatted tables, message-only responses show the message with a checkmark.
  8. pb SDK — New convenience methods: pb.dump() / pb.dumpJson() / pb.dumpText() for full UI hierarchy, pb.dumpc() / pb.dumpcJson() / pb.dumpcText() for compact hierarchy, pb.close() for connection management.
  9. pb SDK — New utility functions: findNode / findAll for searching JSON dump trees (supports attribute match, regex, and function predicates), waitForNode / waitForNodeAction for device-side node waiting with auto id→resource_id mapping, randomPointInBounds for natural-looking taps.
  10. pb SDK — success() / failure() now handle uncaught exceptions automatically when utils is imported.

更新内容

npm install -g phonebase-cli   # 首次安装
pb update && pb --version      # 升级
  1. pb package info <包名> / pb package icon <包名> — 新增两段式子命令,查询应用详情和提取启动图标。替代旧的 pb icon 别名。
  2. pb package info — 设备上不存在的包名返回 404 和明确的错误消息。
  3. pb text — 新增 --clear 和 --submit 参数。--clear 输入前清空输入框,--submit 输入后自动回车。示例:pb text "hello world" --clear --submit。
  4. pb text — 修复数字输入问题。之前输入长数字(如手机号)会被转成科学计数法。
  5. pb dump / pb dumpc — 支持 format=json 参数,返回结构化 JSON。示例:pb -j '{"format":"json"}' dump。
  6. pb — JSON 输出格式统一为 {code, data, msg, cost},所有命令格式一致。
  7. pb — 改善人类格式输出:布尔结果显示本地化的成功/失败标记,有数据的命令显示格式化表格,纯消息命令显示带 ✓ 的消息。
  8. pb SDK — 新增便捷方法:pb.dump() / pb.dumpJson() / pb.dumpText() 获取完整 UI 层级,pb.dumpc() / pb.dumpcJson() / pb.dumpcText() 获取精简层级,pb.close() 主动关闭连接。
  9. pb SDK — 新增工具函数:findNode / findAll 搜索 JSON dump 树(支持属性匹配、正则、函数断言),waitForNode / waitForNodeAction 设备端等待 UI 元素(自动 id→resource_id 映射),randomPointInBounds 自然点击坐标。
  10. pb SDK — 导入 utils 后自动捕获未处理异常,通过 success() / failure() 标准化输出。