我想在ant-script中运行这段代码:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -workspace \APPNAME.xcworkspace -scheme APPNAMETarget build
到目前为止,我有这个:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
</exec>
</target>
</project>
但我还需要添加Build Settings(ARCHS =“armv7 armv7s”ONLY_ACTIVE_ARCH = NO),但不知道如何在脚本中添加它们。我试过了
<env key="ONLY_ACTIVE_ARCH" value="NO"/>
但它不起作用。
答案 0 :(得分:1)
我找到了解决方案。我只需要将它们添加为另一个参数,但是我必须摆脱命令行中没有的括号。我希望它对其他人有帮助,因为我花了一些时间在这上面:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
<arg value="ARCHS=armv7 armv7s"/>
<arg value="ONLY_ACTIVE_ARCH=NO"/>
</exec>
</target>
</project>