我目前正在使用AppleScript来清理Xcode项目。我希望我的脚本删除一些与我团队中的其他开发人员无关的构建配置。
例如,如果我有“Debug”,“DebugTest”和“Release”,我希望脚本删除“DebugTest”。
我目前正在使用以下脚本:
tell application "Xcode"
open myXcodeProject
set targetProject to project of active project document
set targetConfigurations to build configurations of targetProject
repeat with c in targetConfigurations
if (name of c is equal to "DebugTest") then
delete c
end if
end repeat
end tell
但是,当我运行脚本时,我收到以下错误,这让我感到相信我没有正确删除配置:
Xcode got an error: AppleEvent handler failed. (-10000)
谢谢!
答案 0 :(得分:2)
试试这个......
tell application "Xcode"
set targetProject to project of active project document
tell targetProject
delete (first build configuration type whose name is "DebugTest")
end tell
end tell