Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Commit bb04b12

Browse files
.
1 parent defa228 commit bb04b12

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dist/unity-install.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ function Run {
359359
if ($modules -contains 'android') {
360360
if (-not $IsMacOS) {
361361
$rootEditorPath = (Get-Item $editorPath).Directory.Parent.FullName
362-
} else{
363-
$rootEditorPath = $editorPath
362+
$androidSdkPath = "$rootEditorPath/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
363+
}
364+
else {
365+
$rootEditorPath = (Get-Item $editorPath).Directory.Parent.FullName
366+
$androidSdkPath = "$rootEditorPath/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
364367
}
365-
# try to resolve the android cmdline tools path. The version isn't always latest. Just get first directory
366-
# C:/Program Files/Unity/Hub/Editor/2022.3.36f1/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools/6.0/bin/sdkmanager
367-
$androidSdkPath = "$rootEditorPath/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
368368
if (-not (Test-Path -Path $androidSdkPath)) {
369369
Write-Error "Failed to resolve Android SDK cmdline-tools path at `"$androidSdkPath`""
370370
exit 1

src/unity-install.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ function Run {
359359
if ($modules -contains 'android') {
360360
if (-not $IsMacOS) {
361361
$rootEditorPath = (Get-Item $editorPath).Directory.Parent.FullName
362-
} else{
363-
$rootEditorPath = $editorPath
362+
$androidSdkPath = "$rootEditorPath/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
363+
}
364+
else {
365+
$rootEditorPath = (Get-Item $editorPath).Directory.Parent.FullName
366+
$androidSdkPath = "$rootEditorPath/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
364367
}
365-
# try to resolve the android cmdline tools path. The version isn't always latest. Just get first directory
366-
# C:/Program Files/Unity/Hub/Editor/2022.3.36f1/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools/6.0/bin/sdkmanager
367-
$androidSdkPath = "$rootEditorPath/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/cmdline-tools"
368368
if (-not (Test-Path -Path $androidSdkPath)) {
369369
Write-Error "Failed to resolve Android SDK cmdline-tools path at `"$androidSdkPath`""
370370
exit 1

0 commit comments

Comments
 (0)