Skip to content

Commit 0e01b3b

Browse files
authored
Merge pull request #245 from RobotsAndPencils/matt/xcodeReleasesAppleLogin
restore downloading via xcodereleases with apple username/password :(
2 parents fb55a9a + a8180aa commit 0e01b3b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/XcodesKit/XcodeInstaller.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public final class XcodeInstaller {
286286
// session once we're ready to download Xcode. Doing that requires us to know the
287287
// URL we want to download though (and we may not know that yet), so we don't need
288288
// to do anything session-related quite yet.
289-
return Promise()
289+
return sessionService.loginIfNeeded()
290290
}
291291
}
292292
.then { () -> Promise<Void> in
@@ -313,7 +313,12 @@ public final class XcodeInstaller {
313313
case .xcodeReleases:
314314
/// Now that we've used Xcode Releases to determine what URL we should use to
315315
/// download Xcode, we can use that to establish an anonymous session with Apple.
316-
return self.sessionService.validateADCSession(path: xcode.downloadPath).map { xcode }
316+
// As of Nov 2022, the `validateADCSession` return 403 forbidden for Xcode versions (works with runtimes)
317+
// return self.sessionService.validateADCSession(path: xcode.downloadPath).map { xcode }
318+
// -------
319+
// We need the cookies from its response in order to download Xcodes though,
320+
// so perform it here first just to be sure.
321+
return Current.network.dataTask(with: URLRequest.downloads).map { _ in xcode }
317322
}
318323
}
319324
.then { xcode -> Promise<(Xcode, URL)> in

0 commit comments

Comments
 (0)