@@ -56,42 +56,55 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
5656 fi
5757
5858elif [[ " $OSTYPE " == " darwin" * ]]; then
59- # macOS - Create IPA from .app bundle (unsigned builds don't create IPA automatically)
59+ # macOS - Create proper IPA from .app bundle
6060 IPA_PATH=" build/ios/ipa/lam7a.ipa"
6161
6262 # Check if IPA already exists
6363 if [ ! -f " $IPA_PATH " ]; then
6464 echo " 📦 IPA not found, creating from .app bundle..."
6565
66- # Find the .app bundle in xcarchive (prefer this) or fallback to any .app
67- APP_PATH=$( find build/ios -path " *.xcarchive/Products/Applications/*.app" -type d | head -n 1)
66+ # Find the .app bundle - prefer Release-iphoneos build
67+ APP_PATH=$( find build/ios/Release-iphoneos -name " *.app" -type d | head -n 1)
68+
69+ # Fallback to any .app bundle
6870 if [ -z " $APP_PATH " ]; then
69- APP_PATH=$( find build/ios -name " *.app" -type d | head -n 1)
71+ APP_PATH=$( find build/ios -name " *.app" -type d | grep -v " Runner.app/Frameworks " | head -n 1)
7072 fi
7173
7274 if [ -z " $APP_PATH " ] || [ ! -d " $APP_PATH " ]; then
7375 echo " ❌ No .app bundle found in build/ios/"
7476 echo " 🔍 Listing build/ios contents:"
75- ls -la build/ios/ 2> /dev/null || echo " build/ios/ doesn't exist "
77+ find build/ios -name " *.app " -type d 2> /dev/null || echo " No .app bundles found "
7678 exit 1
7779 fi
7880
7981 echo " ✅ Found .app bundle at: ${APP_PATH} "
82+ echo " 📊 .app bundle size: $( du -sh " $APP_PATH " | cut -f1) "
8083
8184 # Create IPA directory
8285 mkdir -p build/ios/ipa
8386
84- # Create Payload directory and copy .app
87+ # Create Payload directory and copy ENTIRE .app with all embedded content
8588 mkdir -p Payload
86- cp -r " $APP_PATH " Payload/
8789
88- # Zip into IPA
89- zip -qr " $IPA_PATH " Payload
90+ # Use ditto to preserve all symlinks, frameworks, and metadata
91+ echo " 📦 Copying .app bundle with all frameworks and resources..."
92+ ditto " $APP_PATH " " Payload/$( basename " $APP_PATH " ) "
93+
94+ # Create IPA with proper compression
95+ echo " 🗜️ Creating IPA archive..."
96+ cd Payload
97+ zip -qry " ../${IPA_PATH} " .
98+ cd ..
9099
91100 # Cleanup
92101 rm -rf Payload
93102
94103 echo " ✅ IPA created at: ${IPA_PATH} "
104+ echo " 📊 IPA size: $( du -sh " $IPA_PATH " | cut -f1) "
105+ else
106+ echo " ✅ IPA already exists at: ${IPA_PATH} "
107+ echo " 📊 IPA size: $( du -sh " $IPA_PATH " | cut -f1) "
95108 fi
96109
97110 # Upload IPA with commit tag
0 commit comments