# Proper post\_build script in xcode for Firebase Crashlytics?

**URL:** https://discourse.cmake.org/t/proper-post-build-script-in-xcode-for-firebase-crashlytics/13465
**Category:** Code
**Tags:** os:macos, gen:xcode, os:ios, tool:cmake
**Created:** [January 23, 2025, 11:55am UTC](https://discourse.cmake.org/t/proper-post-build-script-in-xcode-for-firebase-crashlytics/13465 "2025-01-23T11:55:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shokarta](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/e36b37/32.png) [@shokarta](https://discourse.cmake.org/u/shokarta)
#### Post date: [January 23, 2025, 11:55am UTC](https://discourse.cmake.org/t/proper-post-build-script-in-xcode-for-firebase-crashlytics/13465/1 "2025-01-23T11:55:09Z")

</div>

Hello Guys…

I am trying to properly automatizate [Get started with Firebase Crashlytics](https://firebase.google.com/docs/crashlytics/get-started?platform=ios) step **4C** and **4D**.

when it set manualy, it shall look like this:

 ![image](https://discourse.cmake.org/uploads/default/original/2X/6/67f98a66a623598e7cbd113e993567d111526847.png)

so, what I tried is:

```auto
	set(DWARF_DSYM_FOLDER_PATH "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}")
	set(DWARF_DSYM_FILE "${DWARF_DSYM_FOLDER_PATH}/Contents/Resources/DWARF/${PRODUCT_NAME}")
	set(INFO_PLIST "${DWARF_DSYM_FOLDER_PATH}/Contents/Info.plist")
	set(GOOGLE_SERVICE_INFO_PLIST "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist")
	set(EXECUTABLE_PATH "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)")
	
	add_custom_command(
		TARGET ${TARGET_NAME}
		POST_BUILD
		COMMAND /bin/sh -c "${CMAKE_CURRENT_SOURCE_DIR}/../../extralibs/firebase_ios_sdk/FirebaseCrashlytics/run"
		COMMENT "iOS: Processing and uploading dSYM files to Crashlytics"
		DEPENDS ${DWARF_DSYM_FOLDER_PATH} ${DWARF_DSYM_FILE} ${INFO_PLIST} ${GOOGLE_SERVICE_INFO_PLIST} ${EXECUTABLE_PATH}
	)

```

the link to Crashlytics/run is fine, cmake had an issue with variable “${BUILD\_DIR%/Build/\*}” but I have expected this.  
but all what it does instead is:

 ![image](https://discourse.cmake.org/uploads/default/original/2X/5/5e767bc162d4d3a0987e5d7d0d4f073631675ae8.png)

- from here you can see in red color all differences… some of them might not make anything bad realy, but some do (as the post\_script at the end doesnt work)

Is the another way for me to achieve automatizating the post\_script from the link I posted?

Thank you gurus!
