自动化Xcode'调试>模拟位置命令 [英] Automating Xcode' Debug > Simulate Location command

查看:466
本文介绍了自动化Xcode'调试>模拟位置命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何编程方式来控制 xcode>模拟位置命令?我有外部位置测试脚本我想运行,理想情况下,测试套件可能会导致xcode随意更改已连接手机的位置。

Is there any programmatic way to control the xcode > simulate location command? I have external location test scripts I'd like to run, and ideally the test suite could cause xcode to change the location of the connected phone at will.

这是否可能如果是这样的话?

Is this possible, and if so how?

推荐答案

有一个名为 Pokemon-Go-Controller 完全符合您的要求。

There is a GitHub project called Pokemon-Go-Controller that does exactly what you want.

解决方案概述:


  1. 创建 gpx 文件

  2. 创建空白项目引用(不复制) gpx 文件并在您的设备上运行

  3. 运行自动点击器,它会不断点击在Xcode中更新位置

  4. 使用某些脚本更新 gpx 文件,设备位置将自动更新

  1. Create a gpx file
  2. Create a blank project referencing (not copying) that gpx file and run it on your device
  3. Run auto clicker which will constantly click update location in Xcode
  4. Update gpx file using some script and the device location will be automatically updated

您可以使用此Apple脚本代替自动点击器:

Instead of the auto clicker you can use this Apple Script:

#Will continue update the location to the location name below from Xcode:

property locationName : "pokemonLocation" #name of your gpx filex

###########################
tell application "System Events"
    tell process "Xcode"
        repeat while true
            click menu item locationName of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1
            delay 0.2
        end repeat
    end tell
end tell

这篇关于自动化Xcode'调试>模拟位置命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆