fastlane 2.154.0 → 2.155.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +78 -78
  3. data/deliver/lib/deliver/html_generator.rb +8 -1
  4. data/fastlane/lib/fastlane/actions/create_keychain.rb +5 -1
  5. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +5 -0
  6. data/fastlane/lib/fastlane/version.rb +1 -1
  7. data/fastlane/swift/Deliverfile.swift +1 -1
  8. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  9. data/fastlane/swift/Fastlane.swift +375 -182
  10. data/fastlane/swift/Gymfile.swift +1 -1
  11. data/fastlane/swift/GymfileProtocol.swift +1 -1
  12. data/fastlane/swift/Matchfile.swift +1 -1
  13. data/fastlane/swift/MatchfileProtocol.swift +6 -2
  14. data/fastlane/swift/Precheckfile.swift +1 -1
  15. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  16. data/fastlane/swift/Scanfile.swift +1 -1
  17. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  18. data/fastlane/swift/Screengrabfile.swift +1 -1
  19. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  20. data/fastlane/swift/Snapshotfile.swift +1 -1
  21. data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
  22. data/gym/lib/gym/detect_values.rb +6 -3
  23. data/gym/lib/gym/module.rb +22 -0
  24. data/gym/lib/gym/runner.rb +8 -10
  25. data/match/lib/match/generator.rb +6 -0
  26. data/match/lib/match/options.rb +7 -2
  27. data/match/lib/match/runner.rb +12 -5
  28. data/match/lib/match/spaceship_ensure.rb +7 -9
  29. data/match/lib/match/storage/google_cloud_storage.rb +1 -1
  30. data/sigh/lib/sigh/download_all.rb +42 -27
  31. data/sigh/lib/sigh/module.rb +26 -0
  32. data/sigh/lib/sigh/options.rb +2 -2
  33. data/sigh/lib/sigh/runner.rb +74 -33
  34. data/snapshot/lib/snapshot/options.rb +5 -0
  35. data/snapshot/lib/snapshot/test_command_generator.rb +3 -2
  36. data/snapshot/lib/snapshot/test_command_generator_xcode_8.rb +4 -1
  37. data/spaceship/lib/spaceship/connect_api/client.rb +2 -0
  38. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  39. data/spaceship/lib/spaceship/connect_api/models/app.rb +3 -1
  40. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +17 -5
  41. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +41 -7
  42. data/spaceship/lib/spaceship/connect_api/models/profile.rb +31 -1
  43. data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +46 -4
  44. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +41 -0
  45. data/supply/lib/supply/client.rb +2 -1
  46. data/supply/lib/supply/options.rb +8 -1
  47. metadata +17 -17
@@ -14,4 +14,4 @@ class Gymfile: GymfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -181,4 +181,4 @@ extension GymfileProtocol {
181
181
 
182
182
  // Please don't remove the lines below
183
183
  // They are used to detect outdated files
184
- // FastlaneRunnerAPIVersion [0.9.31]
184
+ // FastlaneRunnerAPIVersion [0.9.32]
@@ -14,4 +14,4 @@ class Matchfile: MatchfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -98,9 +98,12 @@ protocol MatchfileProtocol: class {
98
98
  /// Skip generation of a README.md for the created git repository
99
99
  var skipDocs: Bool { get }
100
100
 
101
- /// Set the provisioning profile's platform to work with (i.e. ios, tvos, macos)
101
+ /// Set the provisioning profile's platform to work with (i.e. ios, tvos, macos, catalyst)
102
102
  var platform: String { get }
103
103
 
104
+ /// Enable this if you have the Mac Catalyst capability enabled and your project was created with Xcode 11.3 or earlier. Prepends 'maccatalyst.' to the app identifier for the provisioning profile mapping
105
+ var deriveCatalystAppIdentifier: Bool { get }
106
+
104
107
  /// The name of provisioning profile template. If the developer account has provisioning profile templates (aka: custom entitlements), the template name can be found by inspecting the Entitlements drop-down while creating/editing a provisioning profile (e.g. "Apple Pay Pass Suppression Development")
105
108
  var templateName: String? { get }
106
109
 
@@ -152,6 +155,7 @@ extension MatchfileProtocol {
152
155
  var skipConfirmation: Bool { return false }
153
156
  var skipDocs: Bool { return false }
154
157
  var platform: String { return "ios" }
158
+ var deriveCatalystAppIdentifier: Bool { return false }
155
159
  var templateName: String? { return nil }
156
160
  var profileName: String? { return nil }
157
161
  var failOnNameTaken: Bool { return false }
@@ -161,4 +165,4 @@ extension MatchfileProtocol {
161
165
 
162
166
  // Please don't remove the lines below
163
167
  // They are used to detect outdated files
164
- // FastlaneRunnerAPIVersion [0.9.25]
168
+ // FastlaneRunnerAPIVersion [0.9.26]
@@ -14,4 +14,4 @@ class Precheckfile: PrecheckfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -33,4 +33,4 @@ extension PrecheckfileProtocol {
33
33
 
34
34
  // Please don't remove the lines below
35
35
  // They are used to detect outdated files
36
- // FastlaneRunnerAPIVersion [0.9.24]
36
+ // FastlaneRunnerAPIVersion [0.9.25]
@@ -14,4 +14,4 @@ class Scanfile: ScanfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -257,4 +257,4 @@ extension ScanfileProtocol {
257
257
 
258
258
  // Please don't remove the lines below
259
259
  // They are used to detect outdated files
260
- // FastlaneRunnerAPIVersion [0.9.36]
260
+ // FastlaneRunnerAPIVersion [0.9.37]
@@ -14,4 +14,4 @@ class Screengrabfile: ScreengrabfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -93,4 +93,4 @@ extension ScreengrabfileProtocol {
93
93
 
94
94
  // Please don't remove the lines below
95
95
  // They are used to detect outdated files
96
- // FastlaneRunnerAPIVersion [0.9.26]
96
+ // FastlaneRunnerAPIVersion [0.9.27]
@@ -14,4 +14,4 @@ class Snapshotfile: SnapshotfileProtocol {
14
14
  // during the `init` process, and you won't see this message
15
15
  }
16
16
 
17
- // Generated with fastlane 2.154.0
17
+ // Generated with fastlane 2.155.0
@@ -127,6 +127,9 @@ protocol SnapshotfileProtocol: class {
127
127
 
128
128
  /// Disable xcpretty formatting of build
129
129
  var disableXcpretty: Bool? { get }
130
+
131
+ /// Suppress the output of xcodebuild to stdout. Output is still saved in buildlog_path
132
+ var suppressXcodeOutput: Bool? { get }
130
133
  }
131
134
 
132
135
  extension SnapshotfileProtocol {
@@ -173,8 +176,9 @@ extension SnapshotfileProtocol {
173
176
  var onlyTesting: String? { return nil }
174
177
  var skipTesting: String? { return nil }
175
178
  var disableXcpretty: Bool? { return nil }
179
+ var suppressXcodeOutput: Bool? { return nil }
176
180
  }
177
181
 
178
182
  // Please don't remove the lines below
179
183
  // They are used to detect outdated files
180
- // FastlaneRunnerAPIVersion [0.9.20]
184
+ // FastlaneRunnerAPIVersion [0.9.21]
@@ -144,10 +144,13 @@ module Gym
144
144
  # Is it an iOS device or a Mac?
145
145
  def self.detect_platform
146
146
  return if Gym.config[:destination]
147
- platform = if Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
148
- min_xcode8? ? "macOS" : "OS X"
149
- elsif Gym.project.tvos?
147
+
148
+ platform = if Gym.project.tvos?
150
149
  "tvOS"
150
+ elsif Gym.building_for_ios?
151
+ "iOS"
152
+ elsif Gym.building_for_mac?
153
+ min_xcode8? ? "macOS" : "OS X"
151
154
  else
152
155
  "iOS"
153
156
  end
@@ -25,6 +25,28 @@ module Gym
25
25
  require 'gym/xcodebuild_fixes/generic_archive_fix'
26
26
  end
27
27
 
28
+ def building_for_ios?
29
+ if Gym.project.mac?
30
+ # Can be building for iOS if mac project and catalyst
31
+ return building_mac_catalyst_for_ios?
32
+ else
33
+ # Can be iOS project and build for mac if catalyst
34
+ return false if building_mac_catalyst_for_mac?
35
+
36
+ # Can be iOS project if iOS, tvOS, or watchOS
37
+ return Gym.project.ios? || Gym.project.tvos? || Gym.project.watchos?
38
+ end
39
+ end
40
+
41
+ def building_for_mac?
42
+ if Gym.project.supports_mac_catalyst?
43
+ # Can be a mac project and not build mac if catalyst
44
+ return building_mac_catalyst_for_mac?
45
+ else
46
+ return Gym.project.mac?
47
+ end
48
+ end
49
+
28
50
  def building_mac_catalyst_for_ios?
29
51
  Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "ios"
30
52
  end
@@ -13,7 +13,6 @@ require_relative 'error_handler'
13
13
  module Gym
14
14
  class Runner
15
15
  # @return (String) The path to the resulting ipa
16
- # rubocop:disable Metrics/PerceivedComplexity
17
16
  def run
18
17
  unless Gym.config[:skip_build_archive]
19
18
  build_app
@@ -24,12 +23,8 @@ module Gym
24
23
 
25
24
  FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory]))
26
25
 
27
- # Determine platform to archive
28
- is_mac = Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
29
- is_ios = !is_mac && (Gym.project.ios? || Gym.project.tvos? || Gym.project.watchos?)
30
-
31
26
  # Archive
32
- if is_ios
27
+ if Gym.building_for_ios?
33
28
  fix_generic_archive unless Gym.project.watchos? # See https://github.com/fastlane/fastlane/pull/4325
34
29
  return BuildCommandGenerator.archive_path if Gym.config[:skip_package_ipa]
35
30
 
@@ -45,7 +40,7 @@ module Gym
45
40
  move_asset_packs
46
41
  move_appstore_info
47
42
  end
48
- elsif is_mac
43
+ elsif Gym.building_for_mac?
49
44
  path = File.expand_path(Gym.config[:output_directory])
50
45
  compress_and_move_dsym
51
46
  if Gym.project.mac_app? || Gym.building_mac_catalyst_for_mac?
@@ -280,11 +275,14 @@ module Gym
280
275
  app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app")
281
276
 
282
277
  UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path)
278
+
279
+ joined_app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
280
+ FileUtils.rm_rf(joined_app_path)
283
281
  FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
284
- app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
282
+
285
283
  UI.success("Successfully exported the .app file:")
286
- UI.message(app_path)
287
- app_path
284
+ UI.message(joined_app_path)
285
+ joined_app_path
288
286
  end
289
287
 
290
288
  # Move the manifest.plist if exists into the output directory
@@ -14,7 +14,13 @@ module Match
14
14
  specific_cert_type = cert_type.to_s
15
15
  end
16
16
 
17
+ platform = params[:platform]
18
+ if platform.to_s == :catalyst.to_s
19
+ platform = :macos.to_s
20
+ end
21
+
17
22
  arguments = FastlaneCore::Configuration.create(Cert::Options.available_options, {
23
+ platform: platform,
18
24
  development: params[:type] == "development",
19
25
  type: specific_cert_type,
20
26
  generate_apple_certs: params[:generate_apple_certs],
@@ -235,14 +235,19 @@ module Match
235
235
  FastlaneCore::ConfigItem.new(key: :platform,
236
236
  short_option: '-o',
237
237
  env_name: "MATCH_PLATFORM",
238
- description: "Set the provisioning profile's platform to work with (i.e. ios, tvos, macos)",
238
+ description: "Set the provisioning profile's platform to work with (i.e. ios, tvos, macos, catalyst)",
239
239
  default_value: default_platform,
240
240
  default_value_dynamic: true,
241
241
  verify_block: proc do |value|
242
242
  value = value.to_s
243
- pt = %w(tvos ios macos)
243
+ pt = %w(tvos ios macos catalyst)
244
244
  UI.user_error!("Unsupported platform, must be: #{pt}") unless pt.include?(value)
245
245
  end),
246
+ FastlaneCore::ConfigItem.new(key: :derive_catalyst_app_identifier,
247
+ env_name: "MATCH_DERIVE_CATALYST_APP_IDENTIFIER",
248
+ description: "Enable this if you have the Mac Catalyst capability enabled and your project was created with Xcode 11.3 or earlier. Prepends 'maccatalyst.' to the app identifier for the provisioning profile mapping",
249
+ type: Boolean,
250
+ default_value: false),
246
251
  FastlaneCore::ConfigItem.new(key: :template_name,
247
252
  env_name: "MATCH_PROVISIONING_PROFILE_TEMPLATE_NAME",
248
253
  description: "The name of provisioning profile template. If the developer account has provisioning profile templates (aka: custom entitlements), the template name can be found by inspecting the Entitlements drop-down while creating/editing a provisioning profile (e.g. \"Apple Pay Pass Suppression Development\")",
@@ -207,20 +207,26 @@ module Match
207
207
  return File.basename(cert_path).gsub(".cer", "") # Certificate ID
208
208
  end
209
209
 
210
+ # rubocop:disable Metrics/PerceivedComplexity
210
211
  # @return [String] The UUID of the provisioning profile so we can verify it with the Apple Developer Portal
211
212
  def fetch_provisioning_profile(params: nil, certificate_id: nil, app_identifier: nil, working_directory: nil)
212
213
  prov_type = Match.profile_type_sym(params[:type])
213
214
 
214
215
  names = [Match::Generator.profile_type_name(prov_type), app_identifier]
215
- if params[:platform].to_s == :tvos.to_s
216
+ if params[:platform].to_s == :tvos.to_s || params[:platform].to_s == :catalyst.to_s
216
217
  names.push(params[:platform])
217
218
  end
218
219
 
219
220
  profile_name = names.join("_").gsub("*", '\*') # this is important, as it shouldn't be a wildcard
220
221
  base_dir = File.join(prefixed_working_directory, "profiles", prov_type.to_s)
221
222
 
222
- extension = params[:platform].to_s == :macos.to_s ? ".provisionprofile" : ".mobileprovision"
223
- profiles = Dir[File.join(base_dir, "#{profile_name}#{extension}")]
223
+ extension = ".mobileprovision"
224
+ if [:macos.to_s, :catalyst.to_s].include?(params[:platform].to_s)
225
+ extension = ".provisionprofile"
226
+ end
227
+
228
+ profile_file = "#{profile_name}#{extension}"
229
+ profiles = Dir[File.join(base_dir, profile_file)]
224
230
  if Helper.mac?
225
231
  keychain_path = FastlaneCore::Helper.keychain_path(params[:keychain_name]) unless params[:keychain_name].nil?
226
232
  end
@@ -242,7 +248,7 @@ module Match
242
248
 
243
249
  if profile.nil? || force
244
250
  if params[:readonly]
245
- UI.error("No matching provisioning profiles found for '#{profile_name}'")
251
+ UI.error("No matching provisioning profiles found for '#{profile_file}'")
246
252
  UI.error("A new one cannot be created because you enabled `readonly`")
247
253
  if Dir.exist?(base_dir) # folder for `prov_type` does not exist on first match use for that type
248
254
  all_profiles = Dir.entries(base_dir).reject { |f| f.start_with?(".") }
@@ -303,6 +309,7 @@ module Match
303
309
 
304
310
  return uuid
305
311
  end
312
+ # rubocop:enable Metrics/PerceivedComplexity
306
313
 
307
314
  def device_count_different?(profile: nil, keychain_path: nil, platform: nil)
308
315
  return false unless profile
@@ -320,7 +327,7 @@ module Match
320
327
  Spaceship.device.all_ios_profile_devices.count
321
328
  when :tvos
322
329
  Spaceship.device.all_apple_tvs.count
323
- when :mac
330
+ when :mac, :catalyst
324
331
  Spaceship.device.all_macs.count
325
332
  else
326
333
  Spaceship.device.all.count
@@ -46,6 +46,10 @@ module Match
46
46
  end
47
47
 
48
48
  def certificates_exists(username: nil, certificate_ids: [], platform: nil)
49
+ if platform == :catalyst.to_s
50
+ platform = :macos.to_s
51
+ end
52
+
49
53
  Spaceship.certificate.all(mac: platform == "macos").each do |cert|
50
54
  certificate_ids.delete(cert.id)
51
55
  end
@@ -61,18 +65,12 @@ module Match
61
65
  end
62
66
 
63
67
  def profile_exists(username: nil, uuid: nil, platform: nil)
64
- is_mac = platform == "macos"
65
- found = Spaceship.provisioning_profile.all(mac: is_mac).find do |profile|
68
+ # App Store Connect API does not allow filter of profile by platform or uuid (as of 2020-07-30)
69
+ # Need to fetch all profiles and search for uuid on client side
70
+ found = Spaceship::ConnectAPI::Profile.all.find do |profile|
66
71
  profile.uuid == uuid
67
72
  end
68
73
 
69
- # Look for iOS after looking for macOS (needed for Catalyst apps)
70
- if !found && is_mac
71
- found = Spaceship.provisioning_profile.all(mac: false).find do |profile|
72
- profile.uuid == uuid
73
- end
74
- end
75
-
76
74
  unless found
77
75
  UI.error("Provisioning profile '#{uuid}' is not available on the Developer Portal for the user #{username}, fixing this now for you 🔨")
78
76
  return false
@@ -213,7 +213,7 @@ module Match
213
213
 
214
214
  return DEFAULT_KEYS_FILE_NAME if File.exist?(DEFAULT_KEYS_FILE_NAME)
215
215
 
216
- fastlane_folder_gc_keys_path = File.join(FastlaneCore::FastlaneFolder.path, DEFAULT_KEYS_FILE_NAME)
216
+ fastlane_folder_gc_keys_path = File.join(FastlaneCore::FastlaneFolder.path || Dir.pwd, DEFAULT_KEYS_FILE_NAME)
217
217
  return fastlane_folder_gc_keys_path if File.exist?(fastlane_folder_gc_keys_path)
218
218
 
219
219
  if google_cloud_project_id.to_s.length > 0
@@ -1,5 +1,7 @@
1
1
  require 'spaceship'
2
2
 
3
+ require 'base64'
4
+
3
5
  require_relative 'manager'
4
6
  require_relative 'module'
5
7
 
@@ -12,35 +14,43 @@ module Sigh
12
14
  Spaceship.select_team
13
15
  UI.message("Successfully logged in")
14
16
 
17
+ if download_xcode_profiles
18
+ UI.deprecated("The App Store Connect API does not support querying for Xcode managed profiles: --download_code_profiles is deprecated")
19
+ end
20
+
15
21
  case Sigh.config[:platform].to_s
16
22
  when 'ios'
17
- download_profiles(Spaceship.provisioning_profile.all(xcode: download_xcode_profiles))
18
- xcode_profiles_downloaded?(xcode: download_xcode_profiles, supported: true)
23
+ profile_types = [
24
+ Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_STORE,
25
+ Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_INHOUSE,
26
+ Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_ADHOC,
27
+ Spaceship::ConnectAPI::Profile::ProfileType::IOS_APP_DEVELOPMENT
28
+ ]
19
29
  when 'macos'
20
- download_profiles(Spaceship.provisioning_profile.all(mac: true, xcode: download_xcode_profiles))
21
- xcode_profiles_downloaded?(xcode: download_xcode_profiles, supported: true)
30
+ profile_types = [
31
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_STORE,
32
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DEVELOPMENT,
33
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_APP_DIRECT
34
+ ]
35
+ when 'catalyst'
36
+ profile_types = [
37
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_STORE,
38
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DEVELOPMENT,
39
+ Spaceship::ConnectAPI::Profile::ProfileType::MAC_CATALYST_APP_DIRECT
40
+ ]
22
41
  when 'tvos'
23
- download_profiles(Spaceship.provisioning_profile.all_tvos)
24
- xcode_profiles_downloaded?(xcode: download_xcode_profiles, supported: false)
42
+ profile_types = [
43
+ Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_STORE,
44
+ Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_INHOUSE,
45
+ Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_ADHOC,
46
+ Spaceship::ConnectAPI::Profile::ProfileType::TVOS_APP_DEVELOPMENT
47
+ ]
25
48
  end
26
- end
27
-
28
- # @param xcode [Bool] Whether or not the user passed the download_xcode_profiles flag
29
- # @param supported [Bool] Whether or not this platform supports downloading xcode profiles at all
30
- def xcode_profiles_downloaded?(xcode: false, supported: false)
31
- if supported
32
- if xcode
33
- UI.message("This run also included all Xcode managed provisioning profiles, as you used the `--download_xcode_profiles` flag")
34
- elsif !xcode
35
- UI.message("All Xcode managed provisioning profiles were ignored on this, to include them use the `--download_xcode_profiles` flag")
36
- end
37
49
 
38
- elsif !supported
39
- if xcode
40
- UI.important("Downloading Xcode managed profiles is not supported for platform #{Sigh.config[:platform]}")
41
- return
42
- end
43
- end
50
+ # Filtering on 'profileType' seems to be undocumented as of 2020-07-30
51
+ # but works on both web session and official API
52
+ profiles = Spaceship::ConnectAPI::Profile.all(filter: { profileType: profile_types.join(",") }, includes: "bundleId")
53
+ download_profiles(profiles)
44
54
  end
45
55
 
46
56
  # @param profiles [Array] Array of all the provisioning profiles we want to download
@@ -57,18 +67,22 @@ module Sigh
57
67
  end
58
68
  end
59
69
 
70
+ def pretty_type(profile_type)
71
+ return Sigh.profile_pretty_type(profile_type)
72
+ end
73
+
60
74
  # @param profile [ProvisioningProfile] A profile we plan to download and store
61
75
  def download_profile(profile)
62
76
  FileUtils.mkdir_p(Sigh.config[:output_path])
63
77
 
64
- type_name = profile.class.pretty_type
65
- profile_name = "#{type_name}_#{profile.uuid}_#{profile.app.bundle_id}"
78
+ type_name = pretty_type(profile.profile_type)
79
+ profile_name = "#{type_name}_#{profile.uuid}_#{profile.bundle_id.identifier}"
66
80
 
67
81
  if Sigh.config[:platform].to_s == 'tvos'
68
82
  profile_name += "_tvos"
69
83
  end
70
84
 
71
- if Sigh.config[:platform].to_s == 'macos'
85
+ if ['macos', 'catalyst'].include?(Sigh.config[:platform].to_s)
72
86
  profile_name += '.provisionprofile'
73
87
  else
74
88
  profile_name += '.mobileprovision'
@@ -76,7 +90,8 @@ module Sigh
76
90
 
77
91
  output_path = File.join(Sigh.config[:output_path], profile_name)
78
92
  File.open(output_path, "wb") do |f|
79
- f.write(profile.download)
93
+ content = Base64.decode64(profile.profile_content)
94
+ f.write(content)
80
95
  end
81
96
 
82
97
  Manager.install_profile(output_path) unless Sigh.config[:skip_install]