17

I am doing an archive with xcodebuild (xcode 5) through the command line as so:

xcodebuild -project MyProject.xcodeproj -scheme MyScheme -sdk iphoneos7.0 -configuration Release archive CODE_SIGN_IDENTITY="iPhone Distribution: My ID" -archivePath archive/MyArchive.xcarchive -xcconfig Config/MyReleaseConfig.xcconfig CONFIGURATION_BUILD_DIR=$SRCROOT/build/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME

When I run this, I get my xcarchive generated and console output seems ok. However, when I explore the contents of the archive there is nothing under dSYM. Project settings are verified ok. If I run the same command as above BUT omit the CONFIGURATION_BUILD_DIR bit, I get the dSYM as expected. Do you know if there's a solution for this (i.e. should anything else be set). I want to have control over the build dir.

EDIT:

I've tried setting explicitly from command line (as opposed to in my scheme settings):

DEBUG_INFORMATION_FORMAT="dwarf-with-dsym"

and pos-processing to YES. Still no joy.

Thanks.

John S
  • 1,687
  • 6
  • 21
  • 28

2 Answers2

29

Check again build settings. Take a look at Debug Information Format, it should have DWARF with dSYM file enter image description here

For futher information take a look OS X Man Pages xcodebuild and Xcode Build Setting Reference

Artur Kucaj
  • 1,071
  • 1
  • 11
  • 16
  • Build settings are fine and I get dSYMs when the CONFIGURATION_BUILD_DIR is removed. – John S Feb 18 '14 at 10:46
  • 1
    Try append this: **DEBUG_INFORMATION_FORMAT="dwarf-with-dsym"** – Artur Kucaj Feb 18 '14 at 11:05
  • Only last thing to check: Build Settings -> Apple LLVM compilier 3.1 - Code Generation -> Generate Debug Symbols = YES – Artur Kucaj Feb 18 '14 at 11:32
  • Yup, it is set to YES – John S Feb 18 '14 at 11:37
  • 8
    Maybe, in fact, a dSYM file is generated in other place than the .app? Check environment variables, especially DWARF_DSYM_FOLDER_PATH and DWARF_DSYM_FILE_NAME. To embed the dSYM within the app bundle, just set DWARF_DSYM_FOLDER_PATH to $(CONFIGURATION_BUILD_DIR)/$(EXECUTABLE_FOLDER_PATH) and DWARF_DSYM_FILE_NAME to $(EXECUTABLE_NAME).dSYM. – Artur Kucaj Feb 18 '14 at 11:50
  • 3
    Setting DWARF_DSYM_FOLDER_PATH worked very well :) Thank you, much appreciated! – John S Feb 18 '14 at 11:59
  • 4
    I'd appreciate it if you could show more explicitly exactly how you incorporated the `DWARF_DSYM_FOLDER_PATH` into your command. – Tom Apr 04 '16 at 15:18
  • `DWARF_DSYM_FOLDER_PATH` was the problem for me as well. Maybe the answer should be updated to include it @ArturKucaj – rpecka Dec 04 '20 at 19:26
  • The default value of ```DWARF_DSYM_FOLDER_PATH``` is ```$(CONFIGURATION_BUILD_DIR)```. So if you change the latter, the dSYMs get copied there instead of the .xcarchive. Overridding ```SYMROOT``` can also change those values. – Carl Lindberg Oct 30 '21 at 20:32
1
xcodebuild -project MyProject.xcodeproj -scheme MyScheme -sdk iphoneos7.0 -configuration Release archive CODE_SIGN_IDENTITY="iPhone Distribution: My ID" -archivePath archive/MyArchive.xcarchive -xcconfig Config/MyReleaseConfig.xcconfig CONFIGURATION_BUILD_DIR=$SRCROOT/build/$CONFIGURATION$EFFECTIVE_PLATFORM_NAME

what's your config about DEBUG_INFORMATION_FORMAT in MyReleaseConfig.xcconfig?

kelin
  • 11,323
  • 6
  • 67
  • 104
Acton
  • 503
  • 4
  • 6
  • MyReleaseConfig.xcconfig is the Xcode config ,generally it is generate by cocoaPods, it record some link information and so on as I read it – Acton Jul 27 '17 at 16:20