diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index a77938c0510588..df69dc160c6efa 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 6701249e83ac20..467c276b26d02a 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -16,9 +16,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