Mac is required to build for iOS, but Android development can be done on Mac, Windows or Linux.
We are going to develop an app using Android emulator on your computer, if you really want you can:
- use a real Android device connected to your computer with a cable
- use iPhone emulator / real device (Mac is required)
- We are going to write code using Visual Studio Code
- Latest stable version of
node
must be installed, check the version usingnode -v
. Download latest stable version @nodejs.org if needed. If you have conflicting versions on your local machine and you cannot start the app, try using Node Version Manager to switch between versions.
- Make sure you have Java 8 (aka Java 1.8) installed by executing
java -version
. Installation instructions: - Check that you have
JAVA_HOME
environment variable set to Java 8 location - Android Studio, make sure that you download Android Virtual Device
- You will need to accept all the licences, SDK is probably somewhere in your home folder and there will be instructions on the first launch
Please refer to the official documentation @facebook.github.io or tutorial @egghead.io.
npm run start
in you project root directory, this command starts a JS server:
NB! DO NOT close this terminal session
npx react-native run-android
or npx react-native run-ios
, in your project root directory, this command starts the app on your phone / emulator
NB! We are NOT using Expo!
Go through the offical documentation @facebook.github.io.
Open Android Studio and launch AVD manager from the top-right corner:
Select the device and launch it:
NB! When an emulator opens, you can close Android Studio to save resources on you computer.
If everything went well you should see a working application:
That is it for now, it is recommended to follow the instructions on the screen and get familiar with the mentioned resources.
SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file...
Create a file called local.properties in the android/app directory.
Find Android Sdk location, on Linux it should be in your home folder.
Add single line in the file:
sdk.dir=/home/{your-user-name}/Android/Sdk