8000 GitHub - alexyk/Mobile-App
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alexyk/Mobile-App

 
 

Repository files navigation

Table of Contents


Default information in README.md

Requirements to Run Mobile-App

Common

  • node 8.14.1 (with npm 6.4.1)
    NodeJS version 8.15.x also is likely to work
  • ninja (for Android)
    macOS - brew install ninja, Windows - instructions here
  • react-native-cli npm install -g react-native-cli

For Android

(macOS and Windows)
* Java 1.8 (jdk 8)
* Android Studio or manual installation if SDK and platform tools (look at how to setup an Android project with gradle)

For iOS

(macOS only)
* macOS 10.13 High Sierra or higher (not tested on El Capitan and before)
* Homebrew - http://brew.sh
* CocoaPods (brew install pods)
* Xcode 9.4.1

Steps to Run

Windows

(1) git clone git://github.com/LockTrip/Mobile-app.git
(2) cd <project-folder> for example cd C:\projects\Mobile-App
(3) npm install
(4) react-native run-android

macOS

(1) git clone git://github.com/LockTrip/Mobile-app.git
(2) cd <project-folder> for example cd $HOME$/projects/Mobile-App
(3) npm install
(4) react-native run-ios or react-native run-android

Debugging

Common

(1) put debugger statement in code
(2) debug with "Debug JS Remotely" and a browser

Note: To debug WebView or mobile browser - use:

  • for iOS: Safari/Develop/Simulator...
  • for Android: Chrome/Remote device and choose emulator/device

VSCode

Common

  • Use VSCode breakpoints to or "All expeptions"/"Uncaught exceptions" to break into code
  • If running any task before compilation (preLaunchTask in launch.json) - in VSCode Tasks - make sure to check Terminal view in VSCode if it needs input
  • Use VScode Output/React native... views to see any issues with building the app before installing on device, simulator or emulator
    Tip: Use "Attach to packager" and to skip recompiling the app with xcodebuild

iOS

(1) VScode - use React Native run configurations to create one for iOS
(2) When starting - make sure to have "Debug JS Remotely" ON from the device/emulator (shake it to see Debug menu with this option)
(3) Reload while the footer of VSCode shows as orange
(4) Use VSCode Debug Console view to see console.log output

Android

(1) VScode - use React Native run configurations to create one for Anrdoid
(2) When starting - make sure to have "Debug JS Remotely" ON from the device/emulator (shake it to see Debug menu with this option)
(3) Reload while the footer of VSCode shows as orange
(4) Use Debug Console or Output/LogCat... view to see console.log statements

Additional Requirements to Run E2E Tests

E2E tests (aka integration tests) are using detox (with Grey Box vs the common Black Box approach) with mocha.

E2E on Android

  • ???

E2E on iOS

(macOS only)

  • brew tap wix/brew
  • brew install applesimutils

Tools

Scripts

Scripts are found at:

  • scripts\windows for Windows
  • scripts/ for macOS

Reactotron

  • To start on Windows (with Android):
  1. Run scripts\windows\reactotron-start.bat
  2. Start project with react-native run-android

Staging and Continuous Integration

First application of CI is using Travis CI http://travis-ci.org. Later on to be applied in this branch.


Default Information

Available Scripts

npm start

Runs your app in development mode.

Open it in the Expo app on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal.

Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the --reset-cache flag to the start script:

npm start -- --reset-cache
# or
yarn start -- --reset-cache

npm test

Runs the jest test runner on your tests.

npm run ios

Like npm start, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed.

npm run android

Like npm start, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see React Native docs for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of adb available to Create React Native App:

Using Android Studio's adb
  1. Make sure that you can run adb from your terminal.
  2. Open Genymotion and navigate to Settings -> ADB. Select “Use custom Android SDK tools” and update with your Android SDK directory.
Using Genymotion's adb
  1. Find Genymotion’s copy of adb. On macOS for example, this is normally /Applications/Genymotion.app/Contents/MacOS/tools/.
  2. Add the Genymotion tools directory to your path (instructions for Mac, Linux, and Windows).
  3. Make sure that you can run adb from your terminal.

Other

Writing and Running Tests

This project is set up to use jest for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called __tests__ or with the .test extension to have the files loaded by jest. See the the template project for an example test. The jest documentation is also a wonderful resource, as is the React Native testing tutorial.

Adding Flow

Flow is a static type checker that helps you write code with fewer bugs. Check out this introduction to using static types in JavaScript if you are new to this concept.

React Native works with Flow out of the box, as long as your Flow version matches the one used in the version of React Native.

To add a local dependency to the correct Flow version to a Create React Native App project, follow these steps:

  1. Find the Flow [version] at the bottom of the included .flowconfig
  2. Run npm install --save-dev flow-bin@x.y.z (or yarn add --dev flow-bin@x.y.z), where x.y.z is the .flowconfig version number.
  3. Add "flow": "flow" to the scripts section of your package.json.
  4. Add // @flow to any files you want to type check (for example, to App.js).

Now you can run npm run flow (or yarn flow) to check the files for type errors. You can optionally use a plugin for your IDE or editor for a better integrated experience.

To learn more about Flow, check out its documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 78.5%
  • Objective-C 17.8%
  • Java 1.0%
  • C++ 0.9%
  • Ruby 0.9%
  • C 0.6%
  • Other 0.3%
0