A lot of people use iTerm 2 on macOS. When using run-android or run-ios, Metro is started in Terminal.app even when launched from iterm. Ideally we'd create a new tab or window in iTerm.
Note that run-android already has an option to chose the terminal via an environment variable. It looks like it should work but it didn't when I just tested it.
Current terminal is available behind TERM_PROGRAM (at least on macOS), so we should likely try that before the REACT_TERMINAL and a default one.
You can always open Finder and find the launchPackager.command file under node_modules/react-native/scripts/. Right click the file, choose get info, then change the "Open with:" section to iTerm, and click on Change All.
npx react-native run-ios also open Terminal.app
anyone ... maybe @lucasbento ... clear on why both of these still open Terminal.app, not iTerm?
$ yarn react-native run-ios --terminal iTerm
$ REACT_TERMINAL=iTerm yarn react-native run-ios
I've also tried iTerm.app instead of iTerm and the behavior is the same
macOS 10.17.7
react-native-community/cli: 4.13.1
react-native: 0.63.4
@swrobel I think the --terminal attribute only applies to the build of the project. Metro always loads in teminal.app for me, no matter what you try changing this to. I resolved this with the handy hint from @TheTalonHughes above.
Thanks @mattwoberts but the examples provided in https://github.com/react-native-community/cli/pull/310 indicate that it should work with run-ios...
Most helpful comment
You can always open Finder and find the
launchPackager.commandfile undernode_modules/react-native/scripts/. Right click the file, choose get info, then change the "Open with:" section to iTerm, and click on Change All.