简体   繁体   中英

How to export dsym file from xcarchive on terminal

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM