From d8c3e901a9a8de8ba13b03f7c196a8e8d36fef9f Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 11 Dec 2020 15:58:26 +0100 Subject: [PATCH] better xcode 12 workaround --- scripts/react_native_pods.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index a77938c0510588..8592bb958c4995 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["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" + else + config.build_settings.delete("EXCLUDED_ARCHS[sdk=iphonesimulator*]") + end + end + + project.save() + end +end