This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 505
/
android-setup.ps1
53 lines (38 loc) · 1.82 KB
/
android-setup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$androidSdkHome = $ENV:ANDROID_HOME
if ([string]::IsNullOrWhiteSpace($androidSdkHome))
{
if ($ENV:OS -eq "Windows_NT")
{
$androidSdkHome = "C:\Program Files (x86)\Android\android-sdk\"
}
else
{
$androidSdkHome = Resolve-Path "~/Library/Developer/Xamarin/android-sdk-macosx"
}
Write-Host "Couldn't locate ANDROID_HOME, using: $androidSdkHome"
}
Write-Host "Using Android SDK Home: $androidSdkHome"
Write-Host "Installing Global dotnet android tool..."
dotnet tool install --global --add-source https://www.myget.org/F/xam-dotnet-tools/api/v3/index.json AndroidSdk.Tool
Write-Host "Installing and/or Updating Android SDK..."
Write-Host "This may take awhile..."
android --home="$androidSdkHome" sdk download
Write-Host "Installing API 23..."
android --home="$androidSdkHome" sdk --install="platforms;android-23"
Write-Host "Installing API 24..."
android --home="$androidSdkHome" sdk --install="platforms;android-24"
Write-Host "Installing API 25..."
android --home="$androidSdkHome" sdk --install="platforms;android-25"
Write-Host "Installing API 26..."
android --home="$androidSdkHome" sdk --install="platforms;android-26"
Write-Host "Installing API 27..."
android --home="$androidSdkHome" sdk --install="platforms;android-27"
Write-Host "Installing API 28..."
android --home="$androidSdkHome" sdk --install="platforms;android-28"
Write-Host "Installing API 29..."
android --home="$androidSdkHome" sdk --install="platforms;android-29"
Write-Host "Installing API 29 Emulator Image (x86_64 - google_apis)..."
android --home="$androidSdkHome" sdk --install="system-images;android-29;google_apis;x86_64"
Write-Host "Creating XamarinEmulator virtual device..."
android --home="$androidSdkHome" emulator create XamarinEmulator "system-images;android-29;google_apis;x86_64" --device=Pixel --force
Write-Host "Done!"