有没有以编程方式控制 xcode > 模拟位置
命令的方法?我有外部位置测试脚本需要运行,理想情况下,测试套件可以让 xcode 随意更改连接手机的位置。
如果可能的话,具体怎么做呢?
有没有以编程方式控制 xcode > 模拟位置
命令的方法?我有外部位置测试脚本需要运行,理想情况下,测试套件可以让 xcode 随意更改连接手机的位置。
如果可能的话,具体怎么做呢?
gpx
文件 gpx
文件,并在设备上运行它 gpx
文件,设备位置将自动更新#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
您应该绝对考虑安全测试您的位置感知功能。我今年会参加Black Hat,所以如果你在那里,让我们谈谈吧!
看起来还有苹果脚本解决方案,像这个。
idevicelocation 是一个命令行工具,用于模拟 iOS 设备的地理位置。
使用方法:
$ idevicelocation [OPTIONS] LATITUDE LONGITUDE
通过传递两个参数,即纬度和经度来设置位置:
$ idevicelocation 48.856614 2.3522219000000177
传递负值:
$ idevicelocation 77.432332 -- -7.008373564
停止位置模拟:
$ idevicelocation --stop
选项:
-d 启用连接调试消息。<br/>
-u 指定设备UDID。<br/>
-h 帮助。<br/>
-s 停止设备上的位置模拟。
它使用libimobiledevice库与进程com.apple.dt.simulatelocation通信,该进程也被Xcode内部用于相同的目的。
构建说明在README文件中。
在随意移动之前,请确保挂载正确的开发者映像。
感谢Angulo编写这个很棒的实用工具。
尽管有一个拉取请求已经等待很久,但此工具目前未随libimobiledevice软件包一起提供。