Skip to content

Commit

Permalink
📝 Add new Run Script Phase to Build Phases to remove the simulator ar…
Browse files Browse the repository at this point in the history
…chitectures from the binary when archiving the app to the app store
  • Loading branch information
salmatarzi committed Aug 31, 2017
1 parent 584befd commit ff8e1ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions link.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
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' }
Expand Down Expand Up @@ -43,5 +48,9 @@
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

0 comments on commit ff8e1ee

Please sign in to comment.