Created
May 1, 2014 15:21
-
-
Save acoomans/59e316d7c66ebf3d52eb to your computer and use it in GitHub Desktop.
Change Xcode build specs by merging OSX's specs in iPhone Simulator's specs
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
| #!/bin/bash | |
| # Change Xcode build specs by merging OSX's specs in iPhone Simulator's specs | |
| # This allows to build dynamic libraries for the simulator | |
| PLISTBUDDY="/usr/libexec/PlistBuddy" | |
| ROOT=`xcode-select -print-path` | |
| SIM_SPECS_DIR="$ROOT/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications" | |
| OSX_SPECS_DIR="$ROOT/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications" | |
| SIM_PKG_SPECS="$SIM_SPECS_DIR/iPhone Simulator PackageTypes.xcspec" | |
| SIM_PDT_SPECS="$SIM_SPECS_DIR/iPhone Simulator ProductTypes.xcspec" | |
| OSX_PKG_SPECS="$OSX_SPECS_DIR/MacOSX Package Types.xcspec" | |
| OSX_PDT_SPECS="$OSX_SPECS_DIR/MacOSX Product Types.xcspec" | |
| if [ -f "$SIM_PKG_SPECS.backup" -o -f "$SIM_PDT_SPECS.backup" ] ; then | |
| exit 1 | |
| fi | |
| cp "$SIM_PKG_SPECS" "$SIM_PKG_SPECS.backup" || exit 1 | |
| cp "$SIM_PDT_SPECS" "$SIM_PDT_SPECS.backup" || exit 1 | |
| $PLISTBUDDY -c "Merge \"$OSX_PKG_SPECS\"" "$SIM_PKG_SPECS" | |
| $PLISTBUDDY -c "Merge \"$OSX_PDT_SPECS\"" "$SIM_PDT_SPECS" | |
| echo "Package and product types specs were changed." | |
| echo "Restart Xcode for the changes to take effect." |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works for 5.1