4

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.

Emre Önder
  • 2,408
  • 2
  • 23
  • 73

1 Answers1

5

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
Emre Önder
  • 2,408
  • 2
  • 23
  • 73
  • 2
    This is perfect. If you don't want a zip of the output, omit `-c -k`. If you want all of the dSYMs in your archive, remove `/My_Project_Test.app.dSYM` from the source path. – Sam Soffes Oct 26 '20 at 20:03