Skip to content

Commit

Permalink
fix(emulator-run-cmd): use latest cmdline tools, not the bootstrap ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
Malinskiy committed Jan 21, 2024
1 parent b58aaba commit 27822b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emulator-run-cmd/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export abstract class BaseAndroidSdk implements AndroidSDK {
args += " > /dev/null"
}

await execIgnoreFailure(`bash -c \\\"${this.androidHome()}/cmdline-tools/bootstrap-version/bin/sdkmanager emulator 'cmdline-tools;latest' platform-tools 'system-images;android-${api};${tag};${abi}'${args}"`);
await execIgnoreFailure(`bash -c \\\"${this.androidHome()}/cmdline-tools/latest/bin/sdkmanager emulator 'cmdline-tools;latest' platform-tools 'system-images;android-${api};${tag};${abi}'${args}"`);
}

async installPlatform(api: string, verbose: boolean): Promise<any> {
Expand All @@ -114,7 +114,7 @@ export abstract class BaseAndroidSdk implements AndroidSDK {
args += " > /dev/null"
}

await execIgnoreFailure(`bash -c \\\"${this.androidHome()}/cmdline-tools/bootstrap-version/bin/sdkmanager 'platforms;android-${api}'${args}"`)
await execIgnoreFailure(`bash -c \\\"${this.androidHome()}/cmdline-tools/latest/bin/sdkmanager 'platforms;android-${api}'${args}"`)
}

async createEmulator(name: string, api: string, tag: string, abi: string, hardwareProfile: string): Promise<any> {
Expand All @@ -123,7 +123,7 @@ export abstract class BaseAndroidSdk implements AndroidSDK {
additionalOptions += `--device ${hardwareProfile}`
}

await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/bootstrap-version/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`)
await execIgnoreFailure(`bash -c \\\"echo -n no | ${this.androidHome()}/cmdline-tools/latest/bin/avdmanager create avd -n ${name} --package \\\"system-images;android-${api};${tag};${abi}\\\" --tag ${tag}\" ${additionalOptions}`)
return new Emulator(this, name, api, abi, tag, this.portCounter++, this.portCounter++)
}

Expand Down

0 comments on commit 27822b8

Please sign in to comment.