Skip to content

Commit

Permalink
fix(androidsdk): only download arch independent or matching the host …
Browse files Browse the repository at this point in the history
…archives

This avoid downloading multiple files (one per arch) where the last one will be decompressed over the previous. E.g. ending up having `emulator` as a `arm64` binary on an `x86` Mac.

Previous verbose logs showed:
```
...
  – Downloading https://dl.google.com/android/repository/emulator-darwin_x64-10696886.zip ...
  – Downloading https://dl.google.com/android/repository/emulator-darwin_aarch64-10696886.zip
...
```
  • Loading branch information
spouliot committed Oct 4, 2023
1 parent 7889f0c commit 44deb29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UnoCheck/Checkups/AndroidSdkCheckup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ You can use the Android SDK Manager to install / update them.
{
// Provide a default timeout value of 7 minutes if a value is not provided.
httpClient.Timeout = TimeSpan.FromMinutes(120);
await Task.WhenAll(downloads.Select(d => Download(httpClient, d)));
await Task.WhenAll(downloads.Where(d => (d.HostArch == null) || (d.HostArch == (Util.IsArm64 ? "aarch64" : "x64"))).Select(d => Download(httpClient, d)));
}

installer.Install(sdkInstance, installationSet);
Expand Down

0 comments on commit 44deb29

Please sign in to comment.