ebarnouflant icon indicating copy to clipboard operation
ebarnouflant copied to clipboard

Setup React Native environment on Apple MacBook M1

Open crohr opened this issue 4 years ago • 0 comments

Install rosetta2, so that you can run Intel-only apps on your new ARM chip:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

Install Xcode from the App Store.

Download and install homebrew.

Download and install RVM.

Download and install NVM, follow instructions for updating your ~/.zshrc.

Install node v15 (before that, it's not compatible with M1).

nvm install node

Install ruby 2.7 (3.0 not compatible with fastlane yet?)

rvm install ruby-2.7
rvm --default use 2.7

Install git through homebrew:

brew install git

Install java11 through homebrew (java16 preview17 not compatible with Graddle yet).

brew install java11

Note: could also have a look at https://www.azul.com/downloads/?os=macos&architecture=arm-64-bit&package=jdk for more recent native ARM packages.

Install Android studio

brew install android-studio

Export variables for Android Studio:

# ~/.zshrc
export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"
export ANDROID_HOME=/Users/crohr/Library/Android/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Open Android Studio, let it install dependencies, then go to Preferences > Appearance > System > Android SDK > SDK Tools > Check Android SDK Command-line Tools, and Apply. Otherwise you'll get issue with the sdkmanager licenses.

You should now be able to run yarn android.

crohr avatar Jul 05 '21 13:07 crohr