Skip to content

Instantly share code, notes, and snippets.

@dataich
Created May 1, 2011 13:50
Show Gist options
  • Save dataich/950511 to your computer and use it in GitHub Desktop.
Save dataich/950511 to your computer and use it in GitHub Desktop.
create .dmg image after built on Xcode
set -ex
[ "$ACTION" = build ] || exit 0
[ "$BUILD_VARIANTS" = "normal" ] || exit 0
[ "$CONFIGURATION" = "Release" ] || exit 0
dir="$TEMP_FILES_DIR/disk"
dmg="$HOME/Desktop/$PROJECT_NAME.dmg"
rm -rf "$dir"
mkdir "$dir"
cp -R "$BUILT_PRODUCTS_DIR/$PROJECT_NAME.app" "$dir"
cp -R "$PROJECT_DIR/README.txt" "$dir"
cp -R "$PROJECT_DIR/LICENSE.txt" "$dir"
ln -s "/Applications" "$dir/Applications"
rm -f "$dmg"
hdiutil create -srcfolder "$dir" -volname "$PROJECT_NAME" "$dmg"
rm -rf "$dir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment