Created
October 19, 2013 15:39
-
-
Save jurre/7057447 to your computer and use it in GitHub Desktop.
An easy way to set a macro with your local IP address, just add it as a build phase in Xcode.
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
#!/bin/sh | |
set -e | |
HEADER="${SRCROOT}/LearningSpaces-iPad/ip_address.h" | |
echo "// This file is generated by a build script." > $HEADER | |
echo "// Updated on "`date` >> $HEADER | |
echo "" >> $HEADER | |
ip_address="`ifconfig en0 | grep "inet " | cut -d: -f2 | awk '{print $2}'`" | |
echo "#define LOCAL_IP_ADDRESS @\"http://${ip_address}:3000\"" >> $HEADER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment