fix ios build scpt
This commit is contained in:
@@ -48,25 +48,62 @@ cd ios
|
||||
pod install
|
||||
cd ..
|
||||
|
||||
# 4. Signing (Manual Step)
|
||||
echo "4. Opening Xcode for Signing..."
|
||||
# 4. Signing (Automated)
|
||||
echo "4. Configuring Xcode Signing..."
|
||||
XCODE_PROJ="ios/${APP_NAME}.xcodeproj"
|
||||
# Fallback search if variable name logic differs
|
||||
if [ ! -d "$XCODE_PROJ" ]; then
|
||||
XCODE_PROJ=$(find ios -name "*.xcodeproj" | head -n 1)
|
||||
fi
|
||||
PBXPROJ="$XCODE_PROJ/project.pbxproj"
|
||||
|
||||
open "$XCODE_PROJ"
|
||||
echo "========================================================"
|
||||
echo " [ACTION REQUIRED] "
|
||||
echo " Xcode opened ($XCODE_PROJ)."
|
||||
echo " 1. Go to 'Signing & Capabilities' tab."
|
||||
echo " 2. Select your Team."
|
||||
echo " 3. Verify 'App Clip' target is gone."
|
||||
echo " 4. Ensure no red errors exist."
|
||||
echo " Press ENTER here once you are done to continue building."
|
||||
echo "========================================================"
|
||||
read
|
||||
# Set DEVELOPMENT_TEAM in pbxproj
|
||||
if [ -n "$DEVELOPMENT_TEAM" ]; then
|
||||
echo " Setting DEVELOPMENT_TEAM=$DEVELOPMENT_TEAM"
|
||||
# Add DEVELOPMENT_TEAM to all build configurations
|
||||
sed -i '' "s/PRODUCT_BUNDLE_IDENTIFIER = /DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM; PRODUCT_BUNDLE_IDENTIFIER = /g" "$PBXPROJ"
|
||||
# Also set where it might already exist but be empty
|
||||
sed -i '' "s/DEVELOPMENT_TEAM = \"\";/DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM;/g" "$PBXPROJ"
|
||||
sed -i '' "s/DEVELOPMENT_TEAM = ;/DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM;/g" "$PBXPROJ"
|
||||
fi
|
||||
|
||||
# Create/Update entitlements file with App Group
|
||||
ENTITLEMENTS_FILE="ios/${APP_NAME}/${APP_NAME}.entitlements"
|
||||
if [ -n "$APP_GROUP" ]; then
|
||||
echo " Setting APP_GROUP=$APP_GROUP"
|
||||
cat > "$ENTITLEMENTS_FILE" << EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>${APP_GROUP}</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
# Add CODE_SIGN_ENTITLEMENTS to pbxproj if not present
|
||||
if ! grep -q "CODE_SIGN_ENTITLEMENTS" "$PBXPROJ"; then
|
||||
sed -i '' "s/DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM;/DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM; CODE_SIGN_ENTITLEMENTS = ${APP_NAME}\\/${APP_NAME}.entitlements;/g" "$PBXPROJ"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "✅ Signing configured automatically"
|
||||
|
||||
# (Old manual step - commented out)
|
||||
# open "$XCODE_PROJ"
|
||||
# echo "========================================================"
|
||||
# echo " [ACTION REQUIRED] "
|
||||
# echo " Xcode opened ($XCODE_PROJ)."
|
||||
# echo " 1. Go to 'Signing & Capabilities' tab."
|
||||
# echo " 2. Select your Team."
|
||||
# echo " 3. Verify 'App Clip' target is gone."
|
||||
# echo " 4. Ensure no red errors exist."
|
||||
# echo " Press ENTER here once you are done to continue building."
|
||||
# echo "========================================================"
|
||||
# read
|
||||
|
||||
# 5. Run
|
||||
echo "5. Building and Running..."
|
||||
|
||||
Reference in New Issue
Block a user