From 61fcdf2f77d9934a63f355f7b6ce4c7213a0620e Mon Sep 17 00:00:00 2001 From: cranci1 Date: Thu, 20 Jun 2024 14:32:57 +0200 Subject: [PATCH] nvm fixed the scirpt my bad --- ipabuild.sh | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ipabuild.sh b/ipabuild.sh index d0bc8a10..7ec9d8eb 100755 --- a/ipabuild.sh +++ b/ipabuild.sh @@ -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" \ No newline at end of file +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 \ No newline at end of file