diff --git a/packages/react-native/ReactAndroid/build.gradle b/packages/react-native/ReactAndroid/build.gradle index b382e133158..82b1494a082 100644 --- a/packages/react-native/ReactAndroid/build.gradle +++ b/packages/react-native/ReactAndroid/build.gradle @@ -458,7 +458,7 @@ android { namespace "com.facebook.react" // Used to override the NDK path/version on internal CI or by allowing - // users to customize the NDK path/version from their root project (e.g. for M1 support) + // users to customize the NDK path/version from their root project (e.g. for Apple Silicon support) if (rootProject.hasProperty("ndkPath")) { ndkPath rootProject.ext.ndkPath } diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle b/packages/react-native/ReactAndroid/hermes-engine/build.gradle index cd37019de54..176ee40db0c 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle @@ -130,7 +130,7 @@ android { namespace "com.facebook.hermes" // Used to override the NDK path/version on internal CI or by allowing - // users to customize the NDK path/version from their root project (e.g. for M1 support) + // users to customize the NDK path/version from their root project (e.g. for Apple Silicon support) if (rootProject.hasProperty("ndkPath")) { ndkPath rootProject.ext.ndkPath } diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 80b2c7f87ba..5ca482a1693 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -171,7 +171,7 @@ class ReactNativePodsUtils end if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") - # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) + # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple Silicon) # since the libraries there are only built for x86_64 and i386. lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") diff --git a/packages/react-native/scripts/find-node-for-xcode.sh b/packages/react-native/scripts/find-node-for-xcode.sh index e928cd8e31b..a36bbc23056 100644 --- a/packages/react-native/scripts/find-node-for-xcode.sh +++ b/packages/react-native/scripts/find-node-for-xcode.sh @@ -21,10 +21,10 @@ set -e # the running shell process will choose a node binary and a global package directory breaks version managers unset PREFIX -# Support Homebrew on M1 -HOMEBREW_M1_BIN=/opt/homebrew/bin -if [[ -d $HOMEBREW_M1_BIN && ! $PATH =~ $HOMEBREW_M1_BIN ]]; then - export PATH="$HOMEBREW_M1_BIN:$PATH" +# Support Homebrew on Apple Silicon +HOMEBREW_APPLE_SILICON_BIN=/opt/homebrew/bin +if [[ -d $HOMEBREW_APPLE_SILICON_BIN && ! $PATH =~ $HOMEBREW_APPLE_SILICON_BIN ]]; then + export PATH="$HOMEBREW_APPLE_SILICON_BIN:$PATH" fi # Define NVM_DIR and source the nvm.sh setup script diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index e48f7f604d4..177b3767d64 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -356,7 +356,7 @@ def use_react_native_codegen!(spec, options={}) } end -# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines. +# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon machines. # Call this in the app's main Podfile's post_install hook. # See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context. # Actual fix was authored by https://github.com/mikehardy. diff --git a/packages/rn-tester/README.md b/packages/rn-tester/README.md index 07eb33e3d2a..50fb1c6e7a3 100644 --- a/packages/rn-tester/README.md +++ b/packages/rn-tester/README.md @@ -34,9 +34,9 @@ Both macOS and Xcode are required. 3. Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install` or `yarn setup-ios-hermes`. In order to use JSC instead of Hermes engine, run: `USE_HERMES=0 bundle exec pod install` or `yarn setup-ios-jsc` instead. 4. Open the generated `RNTesterPods.xcworkspace`. This is not checked in, as it is generated by CocoaPods. Do not open `RNTesterPods.xcodeproj` directly. -#### Note for M1 users +#### Note for Apple Silicon users -If you own a Mac M1 laptop, you need to run some different commands to install and run cocoapods. +If you own a Mac laptop with Apple Silicon, you need to run some different commands to install and run cocoapods. - `sudo arch -x86_64 gem install ffi`: this installs the `ffi` package to load dynamically-linked libraries. - `arch -x86_64 pod install`: this run `pod install` with the right architecture. diff --git a/packages/rn-tester/android/app/build.gradle b/packages/rn-tester/android/app/build.gradle index d4cbe004cf1..3c0874e82c9 100644 --- a/packages/rn-tester/android/app/build.gradle +++ b/packages/rn-tester/android/app/build.gradle @@ -94,7 +94,7 @@ android { namespace "com.facebook.react.uiapp" // Used to override the NDK path/version on internal CI or by allowing - // users to customize the NDK path/version from their root project (e.g. for M1 support) + // users to customize the NDK path/version from their root project (e.g. for Apple Silicon support) if (rootProject.hasProperty("ndkPath")) { ndkPath rootProject.ext.ndkPath }