Setup Mac M1 Silicon for ReactNative Development

Set NVM to 18:

nvm install 18
nvm use 18

Install Watchman with Brew

brew install watchman

Ruby Setup

*Install rbenv for Ruby version management *

brew install rbenv

*Set up rbenv in your shel…


This content originally appeared on DEV Community and was authored by Eric Bishard

Set NVM to 18:

nvm install 18 
nvm use 18

Install Watchman with Brew

brew install watchman

Ruby Setup

*Install rbenv for Ruby version management *

brew install rbenv

*Set up rbenv in your shell *

rbenv init

*Install Ruby 2.7.6 (recommended for React Native) *

rbenv install 2.7.6 rbenv global 2.7.6

*Verify Ruby version *

ruby -v

Install Xcode

From Apple Store

[✓] macOS 16.1 (built-in)
[✓] iOS 18.1

Manually Install Xcode iOS Simulator:

  1. Open Xcode
  2. Xcode → Preferences → Components
  3. Download a simulator (iOS 16+ recommended)

Install Xcode command line should now be installed? If not:

xcode-select --install

You can run several commands to verify your Xcode setup:
First, check that Xcode command line tools are installed:

xcode-select --version

Verify Xcode's location:

xcode-select -p

Should typically show /Applications/Xcode.app/Contents/Developer

Check the full Xcode version:

xcodebuild -version

Verify iOS simulator is installed:

xcrun simctl list devices

This should show you a list of available iOS simulators.
If any of these commands fail, you might need to:

Accept Xcode license:

sudo xcodebuild -license accept

Or reinstall command line tools:

xcode-select --install

Install CocoaPods

sudo gem install cocoapods

If CocoaPods doesn't install because there's a Ruby version conflict. Maybe you're running Ruby 2.6.10, but you need at least Ruby 2.7.0.
Here's how to fix this:

Install a newer version of Ruby using Homebrew:

brew install ruby

Add the new Ruby to your PATH in your .zshrc file:

echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc 
source ~/.zshrc

Verify you have the new Ruby version:

ruby -v

(Should show a version >= 2.7.0)

Try installing Cocoapods again:

bashCopysudo gem install cocoapods

After installation, verify Cocoapods is installed:

pod --version

A lot can go wrong at this juncture, I suggest if you have any issues, using Claude or ChatGPT to troubleshoot and don't move on until you can see all versions installed from your terminal and all paths are correct in your .zshrc etc...

Install Android Studio:

brew install --cask android-studio

Android Studio Setup:

  • Open Android Studio
  • Complete initial setup wizard (Choose Custom)
  • Install Android SDK (via Tools → SDK Manager):
    • Android SDK Platform 14 (API 34)
    • Intel x86 Atom_64 System Image or Google APIs Intel x86 Atom System Image
    • Android SDK Build-Tools
    • NDK (Side by side)
    • CMake

Configure Environment Variables:

Add to your ~/.zshrc or ~/.bash_profile:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin

Create Android Virtual Device (AVD):

  • Open Android Studio
  • Tools → AVD Manager
  • Create Virtual Device
  • Select a device definition (e.g., Pixel 4)
  • Select a system image (API 35 recommended)

Verification Steps

Install React Native CLI?

The react-native-cli global package is actually deprecated. Instead, you should use @react-native-community/cli which comes bundled with the npx command.

If already installed, you can safely uninstall the global CLI:

npm uninstall -g react-native-cli

And instead, when creating new projects, use:

npx react-native init ProjectName

This approach is preferred because:

  • It ensures you always use the latest version of the CLI
  • Avoids global package installations
  • Prevents version conflicts

Create a test project:

npx react-native init TestProject --template react-native-template-typescript
cd TestProject

Test iOS setup:

cd ios && pod install && cd ..
npx react-native run-ios

Test Android setup:

# Start Android emulator first
npx react-native run-android

Troubleshooting

If you encounter M1-specific issues:

For iOS: Try adding this to your Podfile:

rubyCopypost_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
    end
  end
end

For Android: Ensure you're using the ARM64 system image when creating AVD


This content originally appeared on DEV Community and was authored by Eric Bishard


Print Share Comment Cite Upload Translate Updates
APA

Eric Bishard | Sciencx (2024-11-05T21:10:11+00:00) Setup Mac M1 Silicon for ReactNative Development. Retrieved from https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/

MLA
" » Setup Mac M1 Silicon for ReactNative Development." Eric Bishard | Sciencx - Tuesday November 5, 2024, https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/
HARVARD
Eric Bishard | Sciencx Tuesday November 5, 2024 » Setup Mac M1 Silicon for ReactNative Development., viewed ,<https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/>
VANCOUVER
Eric Bishard | Sciencx - » Setup Mac M1 Silicon for ReactNative Development. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/
CHICAGO
" » Setup Mac M1 Silicon for ReactNative Development." Eric Bishard | Sciencx - Accessed . https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/
IEEE
" » Setup Mac M1 Silicon for ReactNative Development." Eric Bishard | Sciencx [Online]. Available: https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/. [Accessed: ]
rf:citation
» Setup Mac M1 Silicon for ReactNative Development | Eric Bishard | Sciencx | https://www.scien.cx/2024/11/05/setup-mac-m1-silicon-for-reactnative-development/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.