为app选择或获取xcodebuild目标目录

时间:2014-01-20 20:52:46

标签: ios jenkins xcodebuild appium

当我使用xcodebuild通过命令行构建iOS应用程序时,有没有办法选择目标文件夹(目录)?

现在我正在使用像

这样的命令
xcodebuild -sdk iphonesimulator -workspace /<path_to_project>/ios-app/CompanyName-iOS.xcworkspace -scheme AppName -configuration Debug RUN_APPLICATION_TESTS_WITH_IOS_SIM=YES ONLY_ACTIVE_ARCH=NO clean build 2>&1

在输出中我看到类似

的内容
GenerateDSYMFile /Users/<username>/Library/Developer/Xcode/DerivedData/CompanyName-iOS-fcvhojqctgtmvgdaavahmjutbfyy/Build/Products/Debug-iphonesimulator/AppNAme.app.dSYM

有没有办法让我可以在这个位置输出应用程序,甚至可以指定我希望将应用程序发送到哪里?我需要访问应用程序才能运行Appium selenium测试,只需进行构建执行和运行测试就没有用。还尝试将jenkins合并到混合中,并且需要具有完全自动化过程的命令

2 个答案:

答案 0 :(得分:5)

将CONFIGURATION_BUILD_DIR构建设置设置为您想要的目录。

https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW40

所以在你的例子中:

xcodebuild ...cut... CONFIGURATION_BUILD_DIR=<desired dir> ...cut...

答案 1 :(得分:1)

使用 -derivedDataPath路径将编译后的输出转换为特定文件夹。

xcodebuild -scheme xxx -workspace xxx.xcworkspace ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator -configuration Debug -derivedDataPath ./build  build 

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html