Skip to content

Instantly share code, notes, and snippets.

@bluebanboom
Created September 13, 2013 02:29
Show Gist options
  • Save bluebanboom/6546211 to your computer and use it in GitHub Desktop.
Save bluebanboom/6546211 to your computer and use it in GitHub Desktop.
编译ipa的脚本
#!/bin/bash
outpath="$HOME/"$PRODUCT_NAME"_IPAs"
subdirname=`date "+%Y-%m-%d_%H.%M.%S"`
ipaname=$PRODUCT_NAME"_"$subdirname".ipa"
apppath=$TARGET_BUILD_DIR"/"$PRODUCT_NAME".app"
sympath=$TARGET_BUILD_DIR"/"$PRODUCT_NAME".app.dSYM"
echo $outpath
if [ -d $outpath ]; then
echo $outpath" exist"
else
mkdir $outpath
fi
outpath=$outpath"/"$subdirname
mkdir -p $outpath"/$PRODUCT_NAME/Payload"
cp -R $apppath $outpath"/$PRODUCT_NAME/Payload"
cp -R $sympath $outpath
pushd $outpath
zip -r $ipaname $PRODUCT_NAME
popd
echo "work done!"
#----------------------------
# PRODUCT_NAME="MoreApps"
# TARGET_BUILD_DIR="/Users/sina/Library/Developer/Xcode/DerivedData/MoreApps-boiufivjpkwlrvglsuukvzvxfode/Build/Products/Debug-iphoneos"
# outpath="$HOME/"$PRODUCT_NAME"_IPAs"
# subdirname=`date "+%Y-%m-%d_%H.%M.%S"`
#
# ipaname=$PRODUCT_NAME"_"$subdirname".ipa"
# apppath=$TARGET_BUILD_DIR"/"$PRODUCT_NAME".app"
# sympath=$TARGET_BUILD_DIR"/"$PRODUCT_NAME".app.dSYM"
#
# echo $outpath
# if [ -d $outpath ]; then
# echo $outpath" exist"
# else
# mkdir $outpath
# fi
#
# dirname=`date "+%Y-%m-%d_%H.%M.%S"`
# #workpath=$outpath"/"$dirname
# outpath=$outpath"/"$dirname
# mkdir -p $workpath"/$PRODUCT_NAME/Payload"
# cp -R $TARGET_BUILD_DIR"/"$PRODUCT_NAME".app" $workpath"/$PRODUCT_NAME/Payload"
# cp -R $TARGET_BUILD_DIR"/"$PRODUCT_NAME".app.dSYM" $workpath
# pushd $workpath
# zip -r $PRODUCT_NAME"_"$dirname".ipa" $PRODUCT_NAME
# popd
# echo "work done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment