React Native iOS Environment setup

Source: Internet
Author: User
Tags install node

Some time ago react Native for Android released, feel react Native will be more and more companies began to research, use. So Saturday also took time to build the iOS development environment, so that in the future to take advantage of leisure to learn.

Needless to say, the following is a simple list of steps.
1. Installing homebrew
Homebrew is primarily used to install Watchman, flow
Open your Mac's terminal and enter the following command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 

2. Install NVM and Nodejs
NVM is a tool for NODEJS version management for installing Nodejs.
For NVM it should be possible to use brew direct installation, but I do not use this installation, the reader can use the following command to try:

brew install nvm 

Another way I use it, enter the following command in the terminal:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash 

This command, according to the official instructions, should automatically configure the environment to be able to use the NVM command in any terminal, but I am not able to install. Additional work needs to be done, in ~/.BASHRC, ~/.profile, ~/.ZSHRC files (if not created by yourself), add the following line of statements:

. ~/.nvm/nvm.sh 

This allows the NVM command to be used in any terminal.
Then execute the following command:

nvm install node && nvm alias default node 

This is used to install Nodejs and NPM. NPM is used for NODEJS package-dependent management tools.
3. Installing Watchman
Watchman is a tool for listening for file changes, and should be used to listen for file changes, and then the interface responds. Execute the following command:

brew install watchman 

4. Install flow
Flow I personally understand that the tool for static analysis of JS syntax errors, can be earlier JS syntax errors. Execute the following command:

brew install flow 

Here the basic environment is configured, create an example of iOS below, switch the directory in the terminal to the directory where you saved the project, and then execute the following command:

-g react-native-cli   $ react-native init AwesomeProject     $ cd AwesomeProject/ 
    • 1
    • 2
    • 3

The second command executes for a long time, because a lot of things need to be installed. The terminal then enters the following command to open the project:

open ios/AwesomeProject.xcodeproj
    • 1

This opens the iOS project, and you can see the interface in the emulator as you run it.
Try to modify the text in the Index.ios.js and then press cmd+r on the emulator to see that the changes are immediately presented to the emulator.

The early taste of the end, will have to study hard react Native, look forward to the article.

Original link: React Native iOS Environment building

React-native How to build a development environment (IOS)

React-native Beginner's Guide to iOS--first, prepare for work

React Native iOS Environment setup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.