-
-
Save hotsen/20674da56d2ec4084229fbc02e6448fa to your computer and use it in GitHub Desktop.
"Run Script" for React Native automatic IP configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
| echo "writing to $INFOPLIST" | |
| PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
| echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true | |
| PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)" | |
| echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment