applescript做shell脚本,xcode构建找不到项目
我正在尝试使用 AppleScript 来编译我的所有 Xcode 项目。 我使用命令 do shell script
来调用 Xcode,如下所示:
try
do shell script "xcodebuild -project /Path/MyProject.xcodeproj -nodistribute -activetarget -sdk macosx10.5 -configuration Release build"
on error errMsg
TraceError(errMsg)
return
end try
但是 Xcode 总是抱怨它找不到该项目。
如果我直接在终端中调用相同的命令,它就可以正常工作。
有什么想法吗?
I'm trying to play with AppleScript to compile all my Xcode projects.
I'm using the command do shell script
to call Xcode like this :
try
do shell script "xcodebuild -project /Path/MyProject.xcodeproj -nodistribute -activetarget -sdk macosx10.5 -configuration Release build"
on error errMsg
TraceError(errMsg)
return
end try
But Xcode always complains it can't find the project.
If I call the same command directly in the terminal, it works fine.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它找不到该项目,可能是因为路径中存在一些空格或某些内容,使其无法以您所拥有的形式识别。您通常会“引用”一条路径来解释这些类型的事情。在applescript中我们可以使用“quoted form of”命令来解决这个问题。尝试以下方法,看看是否有帮助。
If it can't find the project it's probably because there are some spaces or something in the path which makes it unrecognizable in the form you have it. You normally would "quote" a path to account for these types of things. In applescript we can use the "quoted form of" command to solve this problem. Give the following a try and see if it helps.