-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
FIX #9617 - Correct find local IP address when running on iOS device #9964
Conversation
By analyzing the blame information on this pull request, we identified @nathanajah and @alexanderjarvis to be potential reviewers. |
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@guilhermebruzzi updated the pull request - view changes |
63ffb93
to
3a81510
Compare
@guilhermebruzzi updated the pull request - view changes |
The error on ci/circleci is "Error: [quit()] Unexpected data in simpleCallback." on e2e Android's test. Which doesn't seams to be related to my changes on xcode script. |
3a81510
to
dfa2c7e
Compare
@guilhermebruzzi updated the pull request - view changes |
dfa2c7e
to
3ee153d
Compare
@guilhermebruzzi updated the pull request - view changes |
3ee153d
to
54b6601
Compare
@guilhermebruzzi updated the pull request - view changes |
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.
Better than what we have now, but I'd rather vote for something more generic. What if en2
instead of en1
?
… device Find your mac's IP Address in en1 (wireless) if it doesn't find it in en0 (wired/ethernet) when react native xcode's script runs on iOS device
54b6601
to
924fa53
Compare
@guilhermebruzzi updated the pull request - view changes |
@Kureev Hi Kureev, I found this article: http://www.askdavetaylor.com/how_do_i_figure_out_my_ip_address_on_a_mac/ And now I implemented a similar way to find your local ip address on a mac, without having to look on every en interface. Now, if the script doesn't find the ip address on en0, it will use ifconfig to find the ip on any other following interfaces. What do you think? |
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.
Definitely better than what we have currently
@facebook-github-bot shipit |
Thanks for your contribution, @guilhermebruzzi! ❤️ |
Thanks for importing. If you are a Facebook employee, you can view this diff on Phabricator. |
8adf78f
@Kureev Thank you! :D |
this fails with an ifconfig output like this: |
something like this works: ifconfig | pcregrep -M -o '^en[^\t:]+:([^\n]|\n\t)*status: active' | grep "inet " | grep -v 127.0.0.1 | cut -d' ' -f2 | awk 'NR==1{print $1}' |
@slicejunk Your code seems good to me (worked on my cases). Why don't you send it on a new pull request replacing the current line: |
Summary: React native's reload javascript option doesn't always work on iOS devices since version 0.29, as described in facebook/react-native#9617 It only doesn't work when you have a mac on a wireless connection, because react-native-xcode.sh can't find your IP address correctly in this case and will just fallback to use the pre-bundling option on your app. This small change in react-native-xcode.sh fixed this issue for our project and should fix this issue for all mac users that use wireless connection and that will run a debug version of the app on a real iOS device. Closes facebook/react-native#9964 Differential Revision: D3923035 fbshipit-source-id: 436cfa2103e10221270034233552ce34720505d3
React native's reload javascript option doesn't always work on iOS devices since version 0.29, as described in #9617
It only doesn't work when you have a mac on a wireless connection, because react-native-xcode.sh can't find your IP address correctly in this case and will just fallback to use the pre-bundling option on your app.
This small change in react-native-xcode.sh fixed this issue for our project and should fix this issue for all mac users that use wireless connection and that will run a debug version of the app on a real iOS device.