开发者

(iphone) build xcode4 project from command line

I've used to build my project with xcodebuild -proj MyProject.xcodeproj -target MyTarget - configuration Debug -sdk iphonesimulator4.3

this works(it builds fine) but when I hit run in xcode, it recompiles.

(with xcode3, there was no need to rebuild once I build using command line)

I suspect xcode build use workspace/scheme rather than project/target.

How do I find out the workspace name that my current xcode project is using?

Thank you

  • edit

Chetan's links gave me directions what to look for.

xcode4 stores build output in ~/Library/... whereas xcodebuild -project .. saves build output in project's build directory. (if you want the workspace capability, you can't use the build directory for build output)

I created a workspace containing my project and ran xcodebuild -workspace myWorkSpace -scheme myScheme

this saves build output in ~/Library/...../Debug-iphon开发者_运维知识库eos

whereas xcode4 run button from the same workspace and same scheme saves output in ~/Library/..../Debug-iphonesimulator

any guess on why xcodebuild command uses Debug-iphoneos? :(

  • edit2

xcodebuild -workspace myWorkSpace -scheme myScheme -sdk iphonesimulator4.3

specifying sdk solved it


I know it isn't strictly the answer to your question, but you can configure the output directory of your build using the CONFIGURATION_BUILD_DIR environment variable.

Source: http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/0-Introduction/introduction.html#//apple_ref/doc/uid/TP40003931-CH1-SW1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜