使用 Golang 来控制你的 iOS 设备~

ElectricBubble · · 3037 次点击 · 开始浏览    置顶
这是一个创建于 的主题,其中的信息可能已经有所发展或是发生改变。

> 有兴趣的小伙伴可以玩一玩哈~ [https://github.com/electricbubble/gwda](https://github.com/electricbubble/gwda) Golang 实现的 WebDriverAgent 客户端库,可以使用 Golang 控制 iOS 设备,实现UI自动化操作。(无需越狱) 参考 facebook-wda (python): [https://github.com/openatx/facebook-wda](https://github.com/openatx/facebook-wda) 几乎完成了 [appium/WebDriverAgent](https://github.com/appium/WebDriverAgent) 的全部命令(部分 `tvOS` 的因为没环境测试。。就暂时放弃了) 放一个示例代码的执行 GIF > ????其实执行速度还可以,只是 GIF 压缩感觉卡顿 ![](https://cdn.jsdelivr.net/gh/ElectricBubble/ImageHosting/img/图像-2.gif) 下面是示例代码的执行输出: ```bash 2020/05/10 00:02:00 Name: TEST’s iPhone 2020/05/10 00:02:00 IsSimulator: false 2020/05/10 00:02:00 UIKit Size (Points): 375 x 667 2020/05/10 00:02:01 UIKit Scale factor: 2 2020/05/10 00:02:01 Native Resolution (Pixels): 750 x 1334 2020/05/10 00:02:02 Status bar size: 375 x 20 2020/05/10 00:02:02 State: Plugged in, at 100% 2020/05/10 00:02:02 Level: 100% 2020/05/10 00:02:02 该 App 未运行, 开始打开 App: com.apple.Preferences 2020/05/10 00:02:04 使当前 App 退回 主屏幕, 并至少等待 3s 后(默认等待时间)再切换到前台 2020/05/10 00:02:09 当前 App 的 PID: 3616 2020/05/10 00:02:33 搜索输入框 的截图图片格式: png 2020/05/10 00:02:33 搜索输入框 的截图图片大小(像素): (594,72) 2020/05/10 00:02:37 共找到 3 个搜索结果 2020/05/10 00:02:48 当前屏幕第一个 App/文件夹 的文本内容: “自带”文件夹 2020/05/10 00:02:48 该 App/文件夹 的坐标和大小: { "y" : 26, "x" : 199, "width" : 64, "height" : 88 } 2020/05/10 00:02:57 Orientation: Device oriented vertically, home button on the bottom 2020/05/10 00:02:57 Rotation: { "x" : 0, "y" : 0, "z" : 0 } ```

有疑问加站长微信联系(非本文作者)

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

3037 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传