如何让本地的 run-ios 在 iTerm 中打开,而不是在 macOS 上打开 Terminal?

如何才能有人配置 react-native run-ios执行在 iTerm 而不是终端在 OSX?默认情况下,它会打开一个新的 Terminal 窗口,但 Terminal 在我的窗口管理器中的工作效果不如 iTerm。

16243 次浏览

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

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