https://github.com/obidosdev/rn-utils
Bash scripts for React-Native developers
https://github.com/obidosdev/rn-utils
bash react-native rn-bash-utils rn-utils shell-scripts terminal
Last synced: about 1 year ago
JSON representation
Bash scripts for React-Native developers
- Host: GitHub
- URL: https://github.com/obidosdev/rn-utils
- Owner: ObidosDev
- License: mit
- Created: 2019-07-23T10:41:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T04:30:36.000Z (over 3 years ago)
- Last Synced: 2025-04-15T10:06:04.987Z (about 1 year ago)
- Topics: bash, react-native, rn-bash-utils, rn-utils, shell-scripts, terminal
- Language: Shell
- Homepage:
- Size: 109 KB
- Stars: 15
- Watchers: 0
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React native utils
[](https://www.npmjs.com/package/rn-bash-utils)
[](https://github.com/ObidosDev/rn-utils/stargazers)
[](https://github.com/ObidosDev/rn-utils/network/members)
[](https://github.com/ObidosDev/rn-utils/issues)
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](#installation)
- [Usage](#usage)
- [General scripts](#general-scripts)
- [clear](#clear)
- [iOS](#ios)
- [remove-derived-data](#remove-derived-data)
- [Android](#android)
- [reverse](#reverse)
- [assemble-release](#assemble-release)
- [install-apk-release](#install-apk-release)
- [bundle-release](#bundle-release)
- [install-bundle-release](#install-bundle-release)
## Installation
```shell
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.
```shell
# Platform specific script
#
rn-utils android reverse
# General script
#
rn-utils clear
```
## General scripts
### clear
```shell
rn-utils clear
```
- Clear watchman watches;
- Delete the `node_modules` folder;
- `npm/yarn` install `node_modules` (depends on lock file);
- Install `pod`s if need;
- Reset Metro Bundler cache;
- Remove haste cache.
---
## iOS
### remove-derived-data
```shell
rn-utils ios remove-derived-data
```
Removing `Derived data` folder.
---
## Android
### reverse
```shell
rn-utils android reverse
```
Calls the method `adb -s reverse tcp: tcp:`.
It allow to choose one of devices attached and enter port.
Links:
1. [React Native: Connecting to the development server](https://facebook.github.io/react-native/docs/running-on-device#connecting-to-the-development-server-1)
---
### assemble-release
```shell
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
```shell
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
```shell
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
```shell
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.
[](https://www.linkedin.com/in/obidosdev/)
[](https://github.com/ObidosDev)
[](https://www.facebook.com/ObidosDev)