Skip to content

Commit 222be01

Browse files
committed
[FIX] iOS 빌드: Xcode 설정 참고하여 PROVISIONING_PROFILE_SPECIFIER를 프로필 이름으로 설정
1 parent 482ef7e commit 222be01

3 files changed

Lines changed: 46 additions & 3 deletions

File tree

.github/workflows/develop.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,21 @@ jobs:
146146
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:com.coby.taba string $PROFILE_UUID" ios/ExportOptions-dev.plist 2>/dev/null || \
147147
/usr/libexec/PlistBuddy -c "Set :provisioningProfiles:com.coby.taba $PROFILE_UUID" ios/ExportOptions-dev.plist 2>/dev/null || true
148148
149-
# Set PROVISIONING_PROFILE_SPECIFIER in Xcode project for Release build
150-
sed -i '' "s/CODE_SIGN_STYLE = Manual;/CODE_SIGN_STYLE = Manual;\n\t\t\t\tPROVISIONING_PROFILE_SPECIFIER = $PROFILE_UUID;/g" ios/Runner.xcodeproj/project.pbxproj || true
149+
# Update Xcode project with PROVISIONING_PROFILE_SPECIFIER using profile name or UUID
150+
# Extract profile name from provisioning profile
151+
TEMP_PLIST=$(mktemp)
152+
security cms -D -i ~/Library/MobileDevice/Provisioning\ Profiles/$PROFILE_UUID.mobileprovision > "$TEMP_PLIST" 2>/dev/null
153+
PROFILE_NAME=$(/usr/libexec/PlistBuddy -c "Print Name" "$TEMP_PLIST" 2>/dev/null || echo "Taba App Store Distribution")
154+
rm -f "$TEMP_PLIST"
155+
156+
# Update PROVISIONING_PROFILE_SPECIFIER in Release and Profile configurations
157+
# Use profile name as shown in Xcode (e.g., "Taba App Store Distribution")
158+
sed -i '' "s/\"PROVISIONING_PROFILE_SPECIFIER\[sdk=iphoneos\*\]\" = \".*\";/\"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]\" = \"$PROFILE_NAME\";/g" ios/Runner.xcodeproj/project.pbxproj || true
151159
152160
echo "Updated ExportOptions:"
153161
cat ios/ExportOptions-dev.plist
162+
echo ""
163+
echo "Using Provisioning Profile: $PROFILE_NAME (UUID: $PROFILE_UUID)"
154164
else
155165
echo "⚠️ No profile UUID found, using ExportOptions as-is"
156166
fi

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,36 @@ jobs:
136136
# Update ExportOptions with provisioning profile UUID if available
137137
if [ -f /tmp/profile_uuid.txt ]; then
138138
PROFILE_UUID=$(cat /tmp/profile_uuid.txt)
139+
echo "Using provisioning profile UUID: $PROFILE_UUID"
140+
141+
# Verify profile exists
142+
if [ -f ~/Library/MobileDevice/Provisioning\ Profiles/$PROFILE_UUID.mobileprovision ]; then
143+
echo "✅ Profile file exists"
144+
else
145+
echo "❌ Profile file NOT found: $PROFILE_UUID.mobileprovision"
146+
exit 1
147+
fi
148+
149+
# Update ExportOptions
139150
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles dict" ios/ExportOptions-prod.plist 2>/dev/null || true
140151
/usr/libexec/PlistBuddy -c "Add :provisioningProfiles:com.coby.taba string $PROFILE_UUID" ios/ExportOptions-prod.plist 2>/dev/null || \
141152
/usr/libexec/PlistBuddy -c "Set :provisioningProfiles:com.coby.taba $PROFILE_UUID" ios/ExportOptions-prod.plist 2>/dev/null || true
153+
154+
# Extract profile name from provisioning profile
155+
TEMP_PLIST=$(mktemp)
156+
security cms -D -i ~/Library/MobileDevice/Provisioning\ Profiles/$PROFILE_UUID.mobileprovision > "$TEMP_PLIST" 2>/dev/null
157+
PROFILE_NAME=$(/usr/libexec/PlistBuddy -c "Print Name" "$TEMP_PLIST" 2>/dev/null || echo "Taba App Store Distribution")
158+
rm -f "$TEMP_PLIST"
159+
160+
# Update PROVISIONING_PROFILE_SPECIFIER in Release and Profile configurations
161+
sed -i '' "s/\"PROVISIONING_PROFILE_SPECIFIER\[sdk=iphoneos\*\]\" = \".*\";/\"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]\" = \"$PROFILE_NAME\";/g" ios/Runner.xcodeproj/project.pbxproj || true
162+
163+
echo "Updated ExportOptions:"
164+
cat ios/ExportOptions-prod.plist
165+
echo ""
166+
echo "Using Provisioning Profile: $PROFILE_NAME (UUID: $PROFILE_UUID)"
167+
else
168+
echo "⚠️ No profile UUID found, using ExportOptions as-is"
142169
fi
143170
144171
flutter build ipa --release \

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,11 @@
502502
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
503503
CLANG_ENABLE_MODULES = YES;
504504
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
505+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
505506
CODE_SIGN_STYLE = Manual;
506507
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
507508
DEVELOPMENT_TEAM = 6M5JX8T4LL;
509+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 3Y8YH8GWMM;
508510
ENABLE_BITCODE = NO;
509511
INFOPLIST_FILE = Runner/Info.plist;
510512
LD_RUNPATH_SEARCH_PATHS = (
@@ -513,6 +515,7 @@
513515
);
514516
PRODUCT_BUNDLE_IDENTIFIER = com.coby.taba;
515517
PRODUCT_NAME = "$(TARGET_NAME)";
518+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Taba App Store Distribution";
516519
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
517520
SWIFT_VERSION = 5.0;
518521
VERSIONING_SYSTEM = "apple-generic";
@@ -688,7 +691,7 @@
688691
CLANG_ENABLE_MODULES = YES;
689692
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
690693
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
691-
DEVELOPMENT_TEAM = 6M5JX8T4LL;
694+
DEVELOPMENT_TEAM = 3Y8YH8GWMM;
692695
ENABLE_BITCODE = NO;
693696
INFOPLIST_FILE = Runner/Info.plist;
694697
LD_RUNPATH_SEARCH_PATHS = (
@@ -711,9 +714,11 @@
711714
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
712715
CLANG_ENABLE_MODULES = YES;
713716
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
717+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
714718
CODE_SIGN_STYLE = Manual;
715719
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
716720
DEVELOPMENT_TEAM = 6M5JX8T4LL;
721+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 3Y8YH8GWMM;
717722
ENABLE_BITCODE = NO;
718723
INFOPLIST_FILE = Runner/Info.plist;
719724
LD_RUNPATH_SEARCH_PATHS = (
@@ -722,6 +727,7 @@
722727
);
723728
PRODUCT_BUNDLE_IDENTIFIER = com.coby.taba;
724729
PRODUCT_NAME = "$(TARGET_NAME)";
730+
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Taba App Store Distribution";
725731
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
726732
SWIFT_VERSION = 5.0;
727733
VERSIONING_SYSTEM = "apple-generic";

0 commit comments

Comments
 (0)