diff --git a/README.md b/README.md index b869b69..fcdb62c 100644 --- a/README.md +++ b/README.md @@ -21,81 +21,83 @@ The app is built in React Native and currently developed for Android. ## Development setup -#### 1. Android Studio - -Install [Android Studio](https://developer.android.com/studio/) - you'll need it to install some dependencies. - -#### 2. Node & npm version - -Make sure you are running Node 14 and npm 6.14.17. It's easiest to switch Node versions using `nvm`, here's how to do it: - - $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash - $ nvm install v14.19.3 - -#### 3. Get this repository +### 1. Get this repository Clone it with SSH - $ git clone git@gitlab.com:bloodyhealth/drip.git + git clone git@gitlab.com:bloodyhealth/drip.git or clone it with HTTPS - $ git clone https://gitlab.com/bloodyhealth/drip.git + git clone https://gitlab.com/bloodyhealth/drip.git + + +### 2. Node & npm version + +Make sure you are running Node 14 and npm 6.14.17. It's easiest to switch Node versions using `nvm`, here's how to do it: + + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash + nvm install v14.19.3 and run - $ cd drip - $ npm install + cd drip + npm install -#### 4. More requirements from Android Studio +### Android + +#### 3.1 Android Studio + +Install [Android Studio](https://developer.android.com/studio/) - you'll need it to install some dependencies. + +#### 3.2 More requirements from Android Studio Open Android Studio and click on "Open an existing Android Studio project". Navigate to the drip repository you cloned and double click the android folder. It detects, downloads and cofigures requirements that might be missing, like the NDK and CMake to build the native code part of the project. Also see the [nodejs-mobile repository](https://github.com/janeasystems/nodejs-mobile) for the necessary prerequisites for your system. -#### 5. Run the app on Android +#### 3.3 Run the app on Android Either start a [virtual device in Android Studio](https://developer.android.com/studio/run/emulator) or [set your physical device like your Android phone up](https://developer.android.com/training/basics/firstapp/running-app) to run the app. 1. Open a terminal and run - ``` - $ npm run android - ``` + npm run android 2. To see logging output, run the following command in another tab: - ``` - $ npm run log - ``` + npm run log 3. Run the following command and select enable hot reloading (see https://facebook.github.io/react-native/docs/debugging.html): - ``` - $ adb shell input keyevent 82 - ``` + adb shell input keyevent 82 4. We recommend installing an [ESLint plugin in your editor](https://eslint.org/docs/user-guide/integrations#editors). There's an `.eslintrc` file in this project which will be used by the plugin to check your code for style errors and potential bugs. -#### 6. Run app on iOS +### iOS + +#### 4.1 Install Cocoapods + +"CocoaPods manages library dependencies for your Xcode projects" + + sudo gem install cocoapods + +#### 4.2 Run app on iOS Minimum system requirements to run iOS app are as follows: - MacOS 10.15.7 for Mac users -- Xcode 12.3 (I assume, that only command line tools might be enough) +- Xcode 12.3 (command line tools only might be enough) 1. Install XCode dependencies by running the following command from the root project directory: -``` -$ cd ios && pod install && cd .. -``` + cd ios && pod install && cd .. 2. To run app either open drip workspace ('drip.xcworkspace' file) with XCode and run "Build" or run the following command: -``` -$ npm run ios -``` + npm run ios 3. If you are building the app with XCode make sure you are running this as well: - `$ npm start` + + npm start ### Troubleshooting @@ -111,12 +113,14 @@ Now, `which java` should output `/Applications/Android Studio.app/Contents/jre/j #### [MacOS] Ninja If `npm` says `CMake was unable to find a build program corresponding to "Ninja".`: -`$ brew install ninja` + + brew install ninja ### [MacOS] adb not on the path If you get error messages about `adb` not being found on your path: -`$ ln -s ~/Library/Android/sdk/platform-tools/adb /usr/local/bin/adb` + + ln -s ~/Library/Android/sdk/platform-tools/adb /usr/local/bin/adb ### [MacOS] and XCode 12.5 @@ -131,7 +135,7 @@ If you experience any further issues, please feel free to check out the followin If you would like to clear project cache and/or re-install project libraries, you can run clear script as follows: - $ npm run clear + npm run clear Script accepts the following options: "none" - script will delete all caches and re-install project libraries, @@ -142,14 +146,15 @@ Script accepts the following options: For example, if you would like to clear android part of the project and re-install project libraries, you can run the following command: - $ npm run clear android npm + npm run clear android npm ## Tests ### Unit tests You can run the tests with: -`$ npm test` + + npm test ### End to end tests