Giter Site home page Giter Site logo

franckffv / macos-react-native-cmd-script Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

This script is a time-saver for React Native developers who want to avoid typing out long commands and navigating between Terminal windows

License: MIT License

Shell 100.00%

macos-react-native-cmd-script's Introduction

macos-react-native-cmd-script

This script is a time-saver for React Native developers who want to avoid typing out long commands and navigating between Terminal windows

Using this script will help you avoid this error on macos Ventura “launchPackager.command” can’t be opened because (null) is not allowed to open documents in Terminal.

React Native Command Script

This is a Bash script that automates running React Native commands on macOS. It checks if the current directory is a React Native project and opens two tabs in the Terminal application. In the first tab, it starts the React Native Metro server using npx react-native start, and in the second tab, it runs the app on either the iOS or Android platform using npx react-native run-ios or npx react-native run-android.

Installation

  1. Clone this repository.
  git clone https://github.com/franckffv/macos-react-native-cmd-script 
  1. Change your working directory to the cloned repository.
  cd macos-react-native-cmd-script
  1. Make the script executable by running
  chmod +x rn.sh
  1. Move the script to your home directory by running :
  mv rn.sh ~/
  1. Open your .bash_profile or .zshrc file and add the following line: alias runrn="~/rn.sh". For zsh :
  echo "alias runrn=\"~/rn.sh\"" >> ~/.zshrc

For bash :

  echo "alias runrn=\"~/rn.sh\"" >> ~/.bash_profile
  1. Reload the shell by running: zsh user:
  source ~/.zshrc

or bash user:

  source ~/.bash_profile

Usage

runrun will open two tabs in the Terminal application, one for the Metro server and the other for running the app on the selected platform. runrn ios will run the app on the iOS platform. runrn android will run the app on the Android platform.

Run with idDevice runrn -id abcd1234 will run the app on the android platform on the device with the ID abcd1234.

macos-react-native-cmd-script's People

Contributors

franckffv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.