Setting Up React Native in Mac M1.
In this story, I will give a quick guide regarding how to setup up the react-native environment in M1,its slightly challenging as not much support and community help is available
After reading this blog you will end up setting up react-native in M1.
So, the first step is that for setting up brew you have to set up rosetta in your Mac for this there are the following commands.
Setting up Rosetta Terminal
softwareupdate --install-rosetta
Once you complete the Rosetta installation, run the below command to install the Homebrew.
After Setting up Rosetta we will create Rosetta Terminal
For this just go to finder and type Utilities and open it and then in utilities create a duplicate terminal.
After Creating a duplicate Terminal right click on the newly generated Terminal and go to get the info section and select open using rosetta.
Now we are going to set up a brew in our new terminal.
For this follow this command.
Setting up brew
/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Woah!! We have Completed 50 % of the work.
Setting Up Xcode
Go To the App Store and download the latest version of Xcode it will take time.
After downloading Xcode We have to set cocoa pods in our Mac.
Set up cocoa pods
Follow the following commands.
brew install cocoapods
sudo gem install ffi
Now we have set up most of the things.
Setup Node:
Go to the node website download the latest version of the node and install it after this hit the following commands.
npm install -g react-native-cli
Create a New react-native-app
Create a new app
react-native init zippy
After creating this go to the ios folder and hit “pod install”.
Now move back to the project directory and hit the following commands.
react-native run-iosreact-native start
Conclusion
Woah!! We are done with setting up the react-native project in Mac M1.