-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify correct terminal to start the packager #24436
Specify correct terminal to start the packager #24436
Conversation
I actually couldn't get this to work (legacy build, fish shell, latest macOS). Turns out that |
@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 |
It doesn't open the terminal at all. I'm really not sure why that happens. I use iTerm. The |
Strange. That's a good idea though, I'll do it. |
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 |
@noahtallen: let's continue the conversation on react-native-community/cli#317, I would like to fix that problem. |
@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
2ecbc0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@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 |
Just tried and still nope (inb4 I restarted Xcode) |
I'll check it here with some of my co-workers to see if I can reproduce that problem. |
I've additionally tried this on a fresh project without pods, with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@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 |
This pull request was successfully merged by @lucasbento in 3273d23. When will my fix make it into a release? | Upcoming Releases |
@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_TERMINAL
environment variable to make sure that the packager will open on the desired terminal.