A seed project to create a native mobile application with Angular and React Native
A seed project to create a native mobile application with Angular and React Native
http://angular.github.io/react-native-renderer/
npm install -g gulp react-native-cli
npm install
Creating the sample project: *
gulp initto create the react-native project
Android: *
gulp start.androidto launch the sample on the connected device or emulator, and watch sources for auto update (if enabled in F2/shake dev menu) use the
Reload JSbutton after the initial red screen
iOS: *
gulp start.iosto launch the sample on an emulator, and watch sources for auto update (it will fail the first due to initial compilation, simply restart it) * OR,
gulp watchand open
.dist/app/ngReactNative/ios/ngReactNative.xcodeprojin Xcode and hit
Run
gulp test.browserto run tests in Chrome
e2e tests are run with Protractor and Appium which need to be installed globally:
npm install -g protractor appium
They can be run in dev mode or in CI mode. The CI mode is slow as it builds a full standalone application, but can be used in SauceLabs.
Open 3 terminals and then: * In the first:
appium* In the second:
gulp start.ios, wait for the application to be fully loaded * In the third:
protractor protractor.conf.ios.dev.jsYou can modify the application or the tests, and run protractor again.
Install xctool:
brew install xctoolBuild the application:
./scripts/build_app_ios.sh
appium* In the second:
protractor protractor.conf.ios.ci.js
Experimental for now, a hack is needed in Protractor for now (remove call to
driver.manage().timeouts().setScriptTimeout(...)in
lib/runner.js)
In the configuration of the virtual device, make sure that the checkbox
Use the Host GPUis active
Open 3 terminals and then: * In the first:
appium* In the second:
gulp start.android, wait for the application to be fully loaded * In the third:
protractor protractor.conf.android.dev.js
You can modify the application or the tests, and run protractor again.
Build the application:
./scripts/build_app_android.shThen open 2 terminals: * In the first:
appium* In the second:
protractor protractor.conf.android.ci.js