📝 Add new Run Script Phase to Build Phases to remove the simulator architectures from the binary when archiving the app to the app store

This commit is contained in:
Salma ElTarzi 2017-09-01 01:49:44 +02:00
parent 584befd354
commit ff8e1ee5f0

View File

@ -16,6 +16,11 @@ target_name = file_name
framework_root = '../node_modules/instabug-reactnative/ios'
framework_name = 'Instabug.framework'
INSTABUG_PHASE_NAME = "Strip Frameworks"
INSTABUG_PHASE_SCRIPT = <<-SCRIPTEND
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Instabug.framework/Instabug.bundle/strip-frameworks.sh"
SCRIPTEND
# Get useful variables
project = Xcodeproj::Project.open(project_location)
frameworks_group = project.groups.find { |group| group.display_name == 'Frameworks' }
@ -43,5 +48,9 @@ build_file = embed_frameworks_build_phase.add_file_reference(framework_ref)
frameworks_build_phase.add_file_reference(framework_ref)
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy', 'RemoveHeadersOnCopy'] }
#Add New Run Script Phase to Build Phases
phase = target.new_shell_script_build_phase(INSTABUG_PHASE_NAME)
phase.shell_script = INSTABUG_PHASE_SCRIPT
# Save Xcode project
project.save