iphone - 在 Ant 脚本中添加 xcodeuild 的build设置

标签 iphone ios xcode ant

我想在 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设置(ARCHS="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>

关于iphone - 在 Ant 脚本中添加 xcodeuild 的build设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15362686/

相关文章:

iphone - 全局定义服务器IP

android - -webkit-溢出-滚动 : touch on android

javascript - 隐藏以前的选项卡和标题 react-navigation v3

ios - DSLCalendarView 重新加载

iphone - 如何在 Objective-C 中以 12 小时格式显示时间?

设备上的 iOS 单元测试无法启动 - HealthKit 权利错误

iphone - 在 UIViewController 上为 UIWebView 设置动画

c++ - "Use of undeclared identifier"- 代码有什么问题?

iphone - iOS截取tableview的截图

ios - 将按钮添加到以编程方式创建的 UIView