How to get react-native run-ios to open in iTerm instead of Terminal on a macOS?

MacosReact Native

Macos Problem Overview


How can somebody configure react-native run-ios to execute in iTerm instead of Terminal on OSX? By default, it opens a new Terminal window, but Terminal doesn't work as well with my window manager as iTerm does.

Macos Solutions


Solution 1 - Macos

Daniel's solution worked, but as soon as I reinstalled node_modules it stopped working.

To make the change persistent, right-click on launchPackager.command in node_modules/react-native/scripts/ and choose Get Info… Then change the "Open with:" section to iTerm, and click on Change All…

enter image description here

Solution 2 - Macos

The packager is started by executing open $PROJECT/node_modules/react-native/scripts/launchPackager.command, so whatever program is associated with *.command will be started. You can change the association:

  • Open Finder
  • Navigate to $PROJECT/node_modules/react-native/scripts/ (or simply create an empty file with the .command extension anywhere)
  • Right click launchPackager.command
  • Press the OPTION key
  • Under "Always open with..." you can select iTerm

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionemmbyView Question on Stackoverflow
Solution 1 - MacosemmbyView Answer on Stackoverflow
Solution 2 - MacosDaniel BasedowView Answer on Stackoverflow