Repository navigation
v1.0.9
What's New
npm install -g phonebase-cli # first install
pb update && pb --version # upgrade
pb package info <package>/pb package icon <package>— New two-part subcommands for querying app details and extracting launcher icons. Replaces the oldpb iconalias.pb package info— Returns 404 with a clear error when the package doesn't exist on the device.pb text— New--clearand--submitflags.--clearclears the input field before typing,--submitpresses Enter after. Example:pb text "hello world" --clear --submit.pb text— Now correctly handles numeric input. Previously, entering a long number like a phone number would garble it into scientific notation.pb dump/pb dumpc— Now supportsformat=jsonparameter to get structured JSON instead of XML/text. Example:pb -j '{"format":"json"}' dump.pb— JSON output format unified to{code, data, msg, cost}across all commands. Simpler and consistent.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.pbSDK — 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.pbSDK — New utility functions:findNode/findAllfor searching JSON dump trees (supports attribute match, regex, and function predicates),waitForNode/waitForNodeActionfor device-side node waiting with autoid→resource_idmapping,randomPointInBoundsfor natural-looking taps.pbSDK —success()/failure()now handle uncaught exceptions automatically when utils is imported.
更新内容
npm install -g phonebase-cli # 首次安装
pb update && pb --version # 升级
pb package info <包名>/pb package icon <包名>— 新增两段式子命令,查询应用详情和提取启动图标。替代旧的pb icon别名。pb package info— 设备上不存在的包名返回 404 和明确的错误消息。pb text— 新增--clear和--submit参数。--clear输入前清空输入框,--submit输入后自动回车。示例:pb text "hello world" --clear --submit。pb text— 修复数字输入问题。之前输入长数字(如手机号)会被转成科学计数法。pb dump/pb dumpc— 支持format=json参数,返回结构化 JSON。示例:pb -j '{"format":"json"}' dump。pb— JSON 输出格式统一为{code, data, msg, cost},所有命令格式一致。pb— 改善人类格式输出:布尔结果显示本地化的成功/失败标记,有数据的命令显示格式化表格,纯消息命令显示带 ✓ 的消息。pbSDK — 新增便捷方法:pb.dump()/pb.dumpJson()/pb.dumpText()获取完整 UI 层级,pb.dumpc()/pb.dumpcJson()/pb.dumpcText()获取精简层级,pb.close()主动关闭连接。pbSDK — 新增工具函数:findNode/findAll搜索 JSON dump 树(支持属性匹配、正则、函数断言),waitForNode/waitForNodeAction设备端等待 UI 元素(自动id→resource_id映射),randomPointInBounds自然点击坐标。pbSDK — 导入 utils 后自动捕获未处理异常,通过success()/failure()标准化输出。