我想在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>
但我也需要添加构建设置(arch ="armv7 armv7s" ONLY_ACTIVE_ARCH=NO),但不知道如何在脚本中添加它们。我试着
<env key="ONLY_ACTIVE_ARCH" value="NO"/>
我找到了一个解决方案。我只需要添加它们作为参数,就像其他的一样,但是我必须去掉括号,这在命令行中是可以的。我希望这对其他人有帮助,因为我花了一些时间在这上面:
<?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>