-
Notifications
You must be signed in to change notification settings - Fork 141
Getting Started with Flagship
You'll need a Mac with Xcode to build iOS applications. Windows and Linux computers can be used to develop Android applications.
We recommend following React Native's Getting Started guide for installing all necessary applications and frameworks.
- Click the "React Native CLI Quickstart" tab
- Select the tab corresponding to your development machine's OS: macOS, Windows, or Linux
- Select the tab corresponding to the mobile OS you which to set up: iOS or Android
- Follow the steps in the "Installing Dependencies" section
- Repeat for all mobile OSes you wish to use
In addition to the dependencies listed by React Native, you'll also need Yarn for package management. Please refer to the instructions on their website to install Yarn.
- Fork the Flagship repository into your own Github account
- Clone your fork of Flagship
- Run
yarn
in order to install dependencies and run the TypeScript compiler
If you installed Xcode as part of the setup process, you have everything you need to test in an iOS simulator. Simply run PirateShip (see next section) and a simulator will automatically boot with the application.
React Native cannot automatically start an Android emulator, so you'll need to do one of the following in order to test on Android:
Option 1: create and start an emulator
- Open Android Studio
- Click the AVD Manager button (top right menu)
- If you don't have any virtual devices set up, click Create Virtual Device and follow the wizard
- Select a virtual device and click Start to open the emulator
- You can then run PirateShip (see below) and it will launch on the selected emulator
Option 2: run on a physical device
- Connect an Android device to your computer via USB
- Open the Settings app
- Navigate to "About phone"
- Tap on the "Build number" item 10x in a row to enable developer mode
- Go back to the main Settings menu and select "Developer options"
- Verify that the "USB debugging" checkbox is enabled
- You may need to change your phone's USB mode from charging only to data transfer mode. Refer to your phone's documentation for more information.
- From your computer, run
adb devices
which will list all physical and emulator devices and their debugging status- If the device isn't displayed, either the phone isn't in developer mode, USB debugging mode is disabled, or the USB mode is set to charging only
- If the device is listed as "unauthorized", USB debugging is disabled or you haven't given the current computer permission to access your device. Try tapping "Revoke USB debugging authorizations" and then turn USB debugging off then on again and you should get a prompt to allow debugging
- If the device is listed as "device" debugging should be ready to go. Run
yarn run ship:run-android
(see below) and the application will run on the connected device.
PirateShip is a demo app that can be used to try out Flagship and test new features. Its code is located in /packages/pirateship
.
From the Flagship root directory (not pirateship), run the following:
yarn run ship:init
-
yarn run ship:run-ios
oryarn ship:run-android
Getting Started
- Flagship Technical Introduction
- Setting up Your Development Environment
- Getting Started with Flagship
- Creating a Flagship App
How To
- Running Flagship Apps
- Managing Environments
- Creating App Icons
- Creating Launch Screens
- Signing Your Apps
- Using React Native Permissions v2
- Using SSL Certificate Pinning
- Initializing Multiple Xcode Targets
Major Releases