Skip to content

Commit

Permalink
nvm fixed the scirpt my bad
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed Jun 20, 2024
1 parent 0aa7e72 commit 61fcdf2
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions ipabuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,41 @@

set -e

cd "$(dirname "$0")"

WORKING_LOCATION="$(pwd)"
APPLICATION_NAME="AnimeGen"
BUILD_DIR="$WORKING_LOCATION/build"
DERIVED_DATA_DIR="$BUILD_DIR/DerivedDataApp"
DD_APP_PATH="$DERIVED_DATA_DIR/Build/Products/Release-iphoneos/$APPLICATION_NAME.app"
TARGET_APP="$BUILD_DIR/$APPLICATION_NAME.app"
PAYLOAD_DIR="$WORKING_LOCATION/Payload"
APPLICATION_NAME=AnimeGen

command -v xcodebuild >/dev/null 2>&1 || { echo >&2 "xcodebuild is required but it's not installed. Aborting."; exit 1; }
command -v codesign >/dev/null 2>&1 || { echo >&2 "codesign is required but it's not installed. Aborting."; exit 1; }
command -v zip >/dev/null 2>&1 || { echo >&2 "zip is required but it's not installed. Aborting."; exit 1; }
if [ ! -d "build" ]; then
mkdir build
fi

mkdir -p "$BUILD_DIR"
cd build

xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \
-scheme "$APPLICATION_NAME" \
-configuration Release \
-derivedDataPath "$DERIVED_DATA_DIR" \
-derivedDataPath "$WORKING_LOCATION/build/DerivedDataApp" \
-destination 'generic/platform=iOS' \
clean build \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"

DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/Release-iphoneos/$APPLICATION_NAME.app"
TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app"
cp -r "$DD_APP_PATH" "$TARGET_APP"

codesign --remove "$TARGET_APP"
rm -rf "$TARGET_APP/_CodeSignature" "$TARGET_APP/embedded.mobileprovision"

mkdir -p "$PAYLOAD_DIR"
cp -r "$TARGET_APP" "$PAYLOAD_DIR/$APPLICATION_NAME.app"

strip "$PAYLOAD_DIR/$APPLICATION_NAME.app/$APPLICATION_NAME"

zip -vr "$WORKING_LOCATION/$APPLICATION_NAME.ipa" "$PAYLOAD_DIR"

rm -rf "$TARGET_APP" "$PAYLOAD_DIR"

echo "IPA creation completed successfully: $WORKING_LOCATION/$APPLICATION_NAME.ipa"
if [ -e "$TARGET_APP/_CodeSignature" ]; then
rm -rf "$TARGET_APP/_CodeSignature"
fi
if [ -e "$TARGET_APP/embedded.mobileprovision" ]; then
rm -rf "$TARGET_APP/embedded.mobileprovision"
fi


mkdir Payload
cp -r AnimeGen.app Payload/AnimeGen.app
strip Payload/AnimeGen.app/AnimeGen
zip -vr AnimeGen.ipa Payload
rm -rf AnimeGen.app
rm -rf Payload

0 comments on commit 61fcdf2

Please sign in to comment.