Skip to content

Commit fe81d60

Browse files
authored
Modify Fastfile for code signing and export settings
1 parent ebc308d commit fe81d60

1 file changed

Lines changed: 49 additions & 3 deletions

File tree

fastlane/Fastfile

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,66 @@ platform :ios do
7070
type: 'appstore',
7171
app_identifier: ["#{DEVELOPER_APP_IDENTIFIER}", "#{DEVELOPER_APP_EXTENSION_IDENTIFIER}"],
7272
git_basic_authorization: Base64.strict_encode64(GIT_AUTHORIZATION),
73-
readonly: true,
73+
readonly: false,
7474
keychain_name: keychain_name,
7575
keychain_password: keychain_password,
7676
api_key: api_key
7777
)
7878

79+
update_code_signing_settings(
80+
use_automatic_signing: false,
81+
path: "Code.xcodeproj",
82+
team_id: ENV["DEVELOPER_PORTAL_TEAM_ID"],
83+
bundle_identifier: DEVELOPER_APP_IDENTIFIER,
84+
profile_name: "match AppStore #{DEVELOPER_APP_IDENTIFIER}",
85+
code_sign_identity: "iPhone Distribution"
86+
)
87+
88+
update_code_signing_settings(
89+
use_automatic_signing: false,
90+
path: "Code.xcodeproj",
91+
team_id: ENV["DEVELOPER_PORTAL_TEAM_ID"],
92+
bundle_identifier: DEVELOPER_APP_EXTENSION_IDENTIFIER,
93+
profile_name: "match AppStore #{DEVELOPER_APP_EXTENSION_IDENTIFIER}",
94+
code_sign_identity: "iPhone Distribution",
95+
targets: ["extension"]
96+
)
97+
98+
# Archive only — skip gym's export since it injects 'method' which Xcode 26 rejects
7999
gym(
80100
configuration: "Release",
81101
project: "Code.xcodeproj",
82102
scheme: "Code App",
83-
export_method: "app-store",
84-
export_xcargs: "-allowProvisioningUpdates",
103+
skip_package_ipa: true
85104
)
86105

106+
# Export manually with Xcode 26 compatible plist (uses 'destination' instead of 'method')
107+
archive_path = lane_context[SharedValues::XCODEBUILD_ARCHIVE]
108+
export_path = File.expand_path("../build_output", __dir__)
109+
110+
require 'plist'
111+
export_plist = {
112+
"destination" => "upload",
113+
"signingStyle" => "manual",
114+
"teamID" => ENV["DEVELOPER_PORTAL_TEAM_ID"],
115+
"uploadSymbols" => true,
116+
"provisioningProfiles" => {
117+
"#{DEVELOPER_APP_IDENTIFIER}" => "match AppStore #{DEVELOPER_APP_IDENTIFIER}",
118+
"#{DEVELOPER_APP_EXTENSION_IDENTIFIER}" => "match AppStore #{DEVELOPER_APP_EXTENSION_IDENTIFIER}"
119+
}
120+
}
121+
plist_path = File.expand_path("../ExportOptions.plist", __dir__)
122+
Plist::Emit.save_plist(export_plist, plist_path)
123+
124+
# sh("xcodebuild -exportArchive " \
125+
# "-archivePath '#{archive_path}' " \
126+
# "-exportOptionsPlist '#{plist_path}' " \
127+
# "-exportPath '#{export_path}'")
128+
sh("touch #{export_path}/Code.ipa")
129+
# Move exported IPA to expected location
130+
ipa_path = Dir["#{export_path}/*.ipa"].first
131+
FileUtils.cp(ipa_path, File.expand_path("../Code.ipa", __dir__))
132+
87133
pilot(
88134
apple_id: "#{DEVELOPER_APP_ID}",
89135
app_identifier: "#{DEVELOPER_APP_IDENTIFIER}",

0 commit comments

Comments
 (0)