Last active
July 19, 2016 20:34
-
-
Save mschwartz/9365e9d56bb6166b83ea to your computer and use it in GitHub Desktop.
"Run Script" for React Native automatic IP configuration
This file contains 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