Search code examples
iosjenkinsxcodebuildappium

Choose or get xcodebuild destination directory for app


Is there a way I can choose the destination folder (directory) for when I build an iOS app via command line using xcodebuild?

Right now I am using a command like

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

In the output I see something like

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

Is there a way I could get this location where the app is output to or even specify where I would rather have the app be sent to? I need access to the app to run Appium selenium tests and just having a build execute and run tests is not helpful. Also trying to incorporate jenkins into the mix and need to have commands to fully automate the process


Solution

  • Set the CONFIGURATION_BUILD_DIR Build Setting to be the directory you want.

    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

    So in your example:

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