diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 480df56be4d5c5..27b8defbb4a151 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -108,3 +108,24 @@ def flipper_post_install(installer) end end end + +def react_native_post_install(installer) + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + .push(installer.pods_project) + + arm_value = `/usr/sbin/sysctl -n hw.optional.arm64 2>&1`.to_i + + projects.each do |project| + project.build_configurations.each do |config| + if arm_value == 1 then + config.build_settings.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]") + else + config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" + end + end + + project.save() + end +end diff --git a/template/ios/Podfile b/template/ios/Podfile index 1b0f64d347bad6..284cce626e320b 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -20,9 +20,15 @@ target 'HelloWorld' do # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and - # you should disable these next few lines. - use_flipper! + # you should disable the next line. + use_flipper!() + post_install do |installer| - flipper_post_install(installer) + react_native_post_install(installer) + + # Enables Flipper. + # + # Disable the next line if you are not using Flipper. + flipper_post_install(installer) end -end +end \ No newline at end of file