https://github.com/code-star/ng2-react-native
https://github.com/code-star/ng2-react-native
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/code-star/ng2-react-native
- Owner: code-star
- License: apache-2.0
- Created: 2016-05-13T07:43:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-13T13:25:23.000Z (about 10 years ago)
- Last Synced: 2025-12-26T02:32:11.811Z (6 months ago)
- Language: JavaScript
- Size: 218 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# R&D Day project - Angular2 + React-native
Mobile app development with [Angular2 and react-native](https://angularjs.blogspot.nl/2016/04/angular-2-react-native.html)
## General documentation
http://angular.github.io/react-native-renderer/
## Preparing your environment
* Set up React Native for iOS and/or Android following [Getting started](https://facebook.github.io/react-native/docs/getting-started.html) and [Android setup](https://facebook.github.io/react-native/docs/android-setup.htmlt)
* Clone this repository or a fork of it
* Install Gulp, React Native CLI and Typings globally: `npm install -g gulp react-native-cli typings`
* Install local npm modules: `npm install`
## Running scripts
Creating the sample project:
* `gulp init` to create the react-native project
Android:
* `gulp start.android` to 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 JS` button after the initial red screen*
iOS:
* `gulp start.ios` to 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 watch` and open `.dist/app/ngReactNative/ios/ngReactNative.xcodeproj` in Xcode and hit `Run`
## Running unit tests
`gulp test.browser` to run tests in Chrome
## Running e2e tests
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.
### iOS
#### Dev mode
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.js`
You can modify the application or the tests, and run protractor again.
#### CI mode
Install xctool: `brew install xctool`
Build the application: `./scripts/build_app_ios.sh`
Then open 2 terminals:
* In the first: `appium`
* In the second: `protractor protractor.conf.ios.ci.js`
### Android
***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 GPU` is active**
#### Dev mode
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.
#### CI mode
Build the application: `./scripts/build_app_android.sh`
Then open 2 terminals:
* In the first: `appium`
* In the second: `protractor protractor.conf.android.ci.js`