项目作者: ObidosDev

项目描述 :
Bash scripts for React-Native developers
高级语言: Shell
项目地址: git://github.com/ObidosDev/rn-utils.git
创建时间: 2019-07-23T10:41:14Z
项目社区:https://github.com/ObidosDev/rn-utils

开源协议:MIT License

下载


React native utils




This is package with useful bash scripts for React-Native developers.

It will eliminate the need of cheatsheet with different scripts for any actions with a project from terminal.

Also it will simplify some usual activities with a project.

Table of Contents

Installation

  1. npm install -g rn-bash-utils

After installation you should relaunch your terminal to enable autocompletion.


Usage

From ROOT of the React-Native project you can run all scripts.

  1. # Platform specific script
  2. # <name_of_the_tool> <platform OR name_of_general_script> <name_of_platform_specific_script>
  3. rn-utils android reverse
  4. # General script
  5. # <name_of_the_tool> <name_of_general_script>
  6. rn-utils clear

General scripts

clear

  1. rn-utils clear
  • Clear watchman watches;
  • Delete the node_modules folder;
  • npm/yarn install node_modules (depends on lock file);
  • Install pods if need;
  • Reset Metro Bundler cache;
  • Remove haste cache.

iOS

remove-derived-data

  1. rn-utils ios remove-derived-data

Removing Derived data folder.


Android

reverse

  1. rn-utils android reverse

Calls the method adb -s <device> reverse tcp:<port> tcp:<port>.

It allow to choose one of devices attached and enter port.

Links:

  1. React Native: Connecting to the development server

assemble-release

  1. rn-utils android assemble-release
  • Remove android/build and android/app/build folders;
  • Calls the method android/gradlew assembleRelease;
  • Copy apk to root of the project (file app-release.apk).

install-apk-release

  1. rn-utils android install-apk-release

Calls the method adb install with file android/app/build/outputs/apk/release/app-release.apk (Generated after gradlew assembleRelease).


bundle-release

  1. rn-utils android bundle-release
  • Remove android/build and android/app/build folders;
  • Calls the method android/gradlew bundleRelease;
  • Copy bundle (.aab) to root of the project (file app.aab).

install-bundle-release

  1. rn-utils android install-bundle-release

It uses values from gradle.properties for signing.

  • Calls the method bundletool build-apks
  • Generated .apks file is ./release_signed.apks
  • Install apk on device with bundletool install-apks

Author

Vitalii Obideiko, Mobile developer.