| Start |
|---|
| Setup for Mac Installing package manager Homebrew Paste that at a Terminal prompt. Installing Xcode IDE Download it using link below or find it on Mac App Store https://developer.apple.com/download/ (opens new window) NOTE: If you have Xcode-beta.app installed along with production version of Xcode.app, make sure you are using production version of Installing Android environment ](https://i.stack.imgur.com/WklQv.png)
Choose both Performance and Android Virtual Device
[ ](https://i.stack.imgur.com/UiNxG.png)
After installation, choose Configure -> SDK Manager from the Android Studio welcome window.
[ ](https://i.stack.imgur.com/JYSu6.png)
In the SDK Platforms window, choose Show Package Details and under Android 6.0 (Marshmallow), make sure that Google APIs, Intel x86 Atom System Image, Intel x86 Atom_64 System Image, and Google APIs Intel x86 Atom_64 System Image are checked.
[ ](https://i.stack.imgur.com/wBiuq.png)
In the SDK Tools window, choose Show Package Details and under Android SDK Build Tools, make sure that Android SDK Build-Tools 23.0.1 is selected.
[ ](https://i.stack.imgur.com/9ZsjC.png)
If you installed the SDK without Android Studio, then it may be something like: /usr/local/opt/android-sdk Dependencies for Mac You will need Xcode for iOS and Android Studio for android, node.js, the React Native command line tools, and Watchman. We recommend installing node and watchman via Homebrew. Watchman (opens new window) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance. It is optional. Node comes with npm, which lets you install the React Native command line interface. If you get a permission error, try with sudo: For iOS the easiest way to install Xcode is via the Mac App Store. And for android download and install Android Studio. If you plan to make changes in Java code, we recommend Gradle Daemon which speeds up the build. Testing your React Native Installation Use the React Native command line tools to generate a new React Native project called "AwesomeProject", then run react-native run-ios inside the newly created folder. You should see your new app running in the iOS Simulator shortly. react-native run-ios is just one way to run your app - you can also run it directly from within Xcode or Nuclide. Modifying your app Now that you have successfully run the app, let's modify it.
Congratulations! You've successfully run and modified your first React Native app. |
| Setup for Linux (Ubuntu) 1) Setup Node.JS Start the terminal and run the following commands to install nodeJS:If node command is unavailableAlternatives NodeJS instalations:or check if you have the current versionRun the npm to install the react-native2) Setup Java 3) Setup Android Studio: Android SDK or Android StudioAndroid SDK e ENV4) Setup emulator: On the terminal run the command Select "SDK Platforms" from within the SDK Manager and you should see a blue checkmark next to "Android 7.0 (Nougat)". In case it is not, click on the checkbox and then "Apply". 5) Start a project Example app init Obs: Always check if the version on |
| Setup for Windows Note: You cannot develop react-native apps for iOS on Windows, only react-native android apps. The official setup docs for react-native on windows can be found here (opens new window). If you need more details there is a granular guide here (opens new window). Tools/Environment
1) Setup your machine for react native development Start the command line as an administrator run the following commands: Restart command line as an administrator so you can run npm After running the last command copy the directory that react-native was installed in. You will need this for Step 4. I tried this on two computers in one case it was: 2) Set your Environment Variables A Step by Step guide with images can be found here for this section. (opens new window) Open the Environment Variables window by navigating to: [Right click] "Start" menu -> System -> Advanced System Settings -> Environment Variables In the bottom section find the "Path" System Variable and add the location that react-native was installed to in step 1. If you haven't added an ANDROID_HOME environment variable you will have to do that here too. While still in the "Environment Variables" window, add a new System Variable with the name "ANDROID_HOME" and value as the path to your android sdk. Then restart the command line as an admin so you can run react-native commands in it. 3) Create your project In command line, navigate to the folder you want to place your project and run the following command: 4) Run your project Start an emulator from android studio Navigate to the root directory of your project in command line and run it: You may run into dependency issues. For example, there may be an error that you do not have the correct build tools version. To fix this you will have to open the sdk manager in Android Studio (opens new window) and download the build tools from there. Congrats! To refresh the ui you can press the RemarksReact Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components. With React Native, you don't build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. You build a real mobile app that's indistinguishable from an app built using Objective-C or Java. React Native uses the same fundamental UI building blocks as regular iOS and Android apps. You just put those building blocks together using JavaScript and React. It is open-source and maintained by Facebook. |
Read Article
https://develop.horje.com/learn/1434/reference