用于使用最新 sdk 的 xcodebuild 参数. [英] parameter for xcodebuild for using latest sdk.

查看:28
本文介绍了用于使用最新 sdk 的 xcodebuild 参数.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ant exec 任务执行 xcodebuild 来构建一些 iOS 项目 hudson.我希望能够以允许不指定 sdk 版本的方式创建脚本,因为在 hudson slave 或我的 iOS 项目上更新 sdk 后,我的所有项目都失败了....

I using ant exec task to execute xcodebuild to build some iOS projects hudson. I would like to be able to crate script that way that allows not to specify sdk version, because after updating sdk on hudson slave or my iOS projects all my projects failing....

自从目标设置中的 sdk 4.2 以来,xcode 中有一个不错的选择 Base SDK - 最新的 iOS

There is is nice option in xcode since sdk 4.2 in target setup Base SDK - Latest iOS

而且我不必在 xcodebuild 命令中提供 -sdk 参数,但是(我认为)它是从 xcode 项目中获取的,这很糟糕,因为有人可以将目标从模拟器更改为设备提交时不小心.

and I don't have to provide -sdk param in xcodebuild command, but then (i think) it's taken from xcode project and it's bad because then some one can change target from simulator to device accidentally during commit.

我需要一些不变的东西.我不想使用 env 变量,因为我希望也能在开发机器上运行这个 ant 任务,并且不想在所有机器上重新设置它.

I need something that is constant. I will prefer not to use env variable because I would like to be able to run this ant task also on dev machines and would like not have to renember about setting it on all machines.

不幸的是 xcodebuild -showsdks 只给出:

Mac OS X SDKs:
    Mac OS X 10.4                   -sdk macosx10.4
    Mac OS X 10.5                   -sdk macosx10.5
    Mac OS X 10.6                   -sdk macosx10.6

iOS SDKs:
    iOS 4.2                         -sdk iphoneos4.2

iOS Simulator SDKs:
    Simulator - iOS 3.2             -sdk iphonesimulator3.2
    Simulator - iOS 4.0             -sdk iphonesimulator4.0
    Simulator - iOS 4.1             -sdk iphonesimulator4.1
    Simulator - iOS 4.2             -sdk iphonesimulator4.2

我需要类似 -sdk iphoneosLatest 的东西.我唯一的想法是用一些脚本来减少 xcodebuild -showsdks 的输出,但我不喜欢这个想法.

I need something like -sdk iphoneosLatest. My only idea is to pare output of xcodebuild -showsdks with some script, but I don't like this idea.

推荐答案

您可以使用 xcodebuild 和最新的 SDK 使用:

You can use xcodebuild with the latest SDK using :

  • xcodebuild -sdk iphoneos,用于设备
  • xcodebuild -sdk iphonesimulator,用于模拟器.
  • xcodebuild -sdk iphoneos, for Device
  • xcodebuild -sdk iphonesimulator, for Simulator.

我们将这些选项用于我们的自动构建,并且自 XCode 3.2.5 起就一直在工作

We use these options for our automated builds and it's been working since XCode 3.2.5

这篇关于用于使用最新 sdk 的 xcodebuild 参数.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆