我目前正在开发一个颤振应用程序使用VSCode和Xcode iOS-模拟器。
在开发过程中,我希望使用自定义位置来模拟“城市运行”,而不是使用预加载的iOS城市运行位置。
我能够将一个自定义城市添加到Xcode-Project (使用..gpx文件),但只能在调试Xcode-Project时使用它。
现在,我无法找到一种方法来更改或更新不在Xcode中运行、而是在VSCode中运行的项目中的城市运行位置。
你们中有谁知道如何做到这一点:
我现在在跑步:
非常感谢各位!任何帮助都将不胜感激!
干杯,托比
发布于 2021-01-31 10:38:25
现在,我找到了一个可能不太漂亮的解决办法,但它为我做了这份工作。
我沿着这篇文章,写了一个小的AppleScript,定期更新当前的位置,并模拟“城市运行”。
虽然它有一些缺点(例如,模拟器必须是最前面的过程),但它为我在开发过程中模拟城市运行做了工作。
不过,如果有人想出了更好的解决方案,请告诉我。
这就是目前脚本看起来的样子:
on run
tell application "System Events"
tell process "Simulator"
set frontmost to true
click menu item "Custom Location…" of menu of menu item "Location" of menu "Features" of menu bar 1
set popup to window "Custom Location"
set value of text field 1 of popup to "<lat here>"
set value of text field 2 of popup to "<long here>"
click button "OK" of popup
delay 2
-- (Further locations here)
end tell
end tell
end run干杯,
托比
https://stackoverflow.com/questions/65958638
复制相似问题