How to export dsym file from xcarchive on terminal

3.3k views Asked by At

I'm getting archive and IPA on Jenkins. I want to upload my dsym to Fabric after I get the build. As you know, xcodebuild generates dsym inside xcarchive/dSYMs folder.

How I get the archive:

/usr/bin/xcodebuild -quiet -workspace My_Project.xcworkspace -scheme My_Project_Test -sdk iphoneos -configuration Release archive -archivePath CONFIGURATION_BUILD_DIR=${WORKSPACE}/build/My_Project_Test.xcarchive

How I get the IPA:

/usr/bin/xcodebuild -exportArchive -archivePath CONFIGURATION_BUILD_DIR=${WORKSPACE}/build/My_Project_Test.xcarchive -exportOptionsPlist My_Project/Resources/Test/Test_ExportOptions.plist -exportPath CONFIGURATION_BUILD_DIR=${WORKSPACE}/build

Example code to get the dsym (which is not working at the moment):

ditto -c -k --keepParent -rsrc "${WORKSPACE}/build/My_Project_Test.app.dSYM" ${WORKSPACE}/build/My_project_Test-${PRODUCT_VERSION}-${PRODUCT_VERSION}-dSYM.zip

Upload code:

$WORKSPACE/Pods/Fabric/upload-symbols -a xxxxxxxxxxxx -p ios -- build/My_Project_Test.app.dSYM

My question is that how can I export dsym file from xcarchive with ditto code or some equal code.

1

There are 1 answers

1
Emre Önder On

I found that we can reach xcarchive file directly. So that below code will work to zip dsym file.

ditto -c -k --keepParent -rsrc "${WORKSPACE}/build/My_Project_Test.xcarchive/dSYMs/My_Project_Test.app.dSYM" ${WORKSPACE}/build/My_Project_Test-${PRODUCT_VERSION}-${PRODUCT_VERSION}-dSYM.zip