Uh oh!
There was an error while loading. Please reload this page.
Specify correct terminal to start the packager - #24436
Conversation
thymikee
commented
Apr 13, 2019
I actually couldn't get this to work (legacy build, fish shell, latest macOS). Turns out that |
lucasbento
commented
Apr 13, 2019
@thymikee: what happens in the end? I'm on macOS 10.14, Hyper installed, legacy build it is working here, maybe Hyper did set it up. I also trying running the app from fishshell.com and it has the |
thymikee
commented
Apr 13, 2019
It doesn't open the terminal at all. I'm really not sure why that happens. I use iTerm. The |
lucasbento
commented
Apr 13, 2019
Strange. That's a good idea though, I'll do it. |
noahtallen
commented
Apr 14, 2019
Nifty! I'm curious - I just opened this issue on the CLI repo. Essentially, I have react imported through Pods, and not at all through the Xcode project. Does this mean that this |
lucasbento
commented
Apr 15, 2019
@noahtallen: let's continue the conversation on react-native-community/cli#317, I would like to fix that problem. |
lucasbento
commented
Apr 15, 2019
@thymikee: I just added a check to verify if it found the default terminal or not, if not just open the packager without specifying it. |
877ed5a to
2ecbc0cCompare
thymikee
left a comment
There was a problem hiding this comment.
After fixing syntax errors (that I see now are fixed :D), when building from command line (run-ios) my default terminal launches, but if I build directly from Xcode, the system Terminal.app is opened.
I googled a bit and I found this:
https://forums.developer.apple.com/thread/8451
Looks like the default for UseSanitizedBuildSystemEnvironment arg for Xcode IDE is YES, and it's the opposite when running xcodebuild and hence the difference. Not sure if there's anything we can do about that other than document it?
lucasbento
commented
Apr 15, 2019
@thymikee: sorry for the syntax error, thought I was testing this but in the end was testing another app. I tried to check if I have If you define it as I'll try to check with a co-worker to see if I can reproduce that on their computer as well. |
Btw I checked with |
thymikee
commented
Apr 15, 2019
Just tried and still nope (inb4 I restarted Xcode) |
lucasbento
commented
Apr 15, 2019
I'll check it here with some of my co-workers to see if I can reproduce that problem. |
thymikee
commented
Apr 15, 2019
I've additionally tried this on a fresh project without pods, with |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
lucasbento
commented
Apr 15, 2019
@thymikee: I tested on two other MacBooks and it's the same behaviour as yours, I'm wondering now if there's any way that we can pass the |
react-native-bot
commented
Apr 15, 2019
This pull request was successfully merged by @lucasbento in 3273d23. When will my fix make it into a release? | Upcoming Releases |
lucasbento
commented
Apr 15, 2019
@thymikee: the only way I see atm to improve this part is to have a way to customize those env variables through a file so that the script can read from it instead of trying to get the global ones, unfortunately this PR will not change the behaviour for people that use Xcode. |
Summary
This PR specifies the correct terminal to start the Metro bundler as stated in react-native-community/cli#303.
Changelog
[iOS] [Changed] - Start the packager on the correct terminal.
Test Plan
To make sure that this works just run it from within Xcode and it should go to your default terminal, you can also try setting the
REACT_TERMINALenvironment variable to make sure that the packager will open on the desired terminal.