Skip to content

Commit fb16093

Browse files
author
Dimitar Tachev
authored
Merge pull request #5184 from NativeScript/release
chore: marge release into master
2 parents cf583a5 + d279ec6 commit fb16093

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/common/mobile/android/android-emulator-services.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { AndroidVirtualDevice } from "../../constants";
22
import { getCurrentEpochTime, sleep } from "../../helpers";
33
import { EOL } from "os";
44
import { LoggerConfigData } from "../../../constants";
5+
import * as semver from "semver";
56

67
export class AndroidEmulatorServices implements Mobile.IEmulatorPlatformService {
78
constructor(private $androidGenymotionService: Mobile.IAndroidVirtualDeviceService,
@@ -144,7 +145,10 @@ export class AndroidEmulatorServices implements Mobile.IEmulatorPlatformService
144145

145146
private getBestFit(emulators: Mobile.IDeviceInfo[]) {
146147
const best = _(emulators).maxBy(emulator => emulator.version);
147-
return (best && best.version >= AndroidVirtualDevice.MIN_ANDROID_VERSION) ? best : null;
148+
const minVersion = semver.coerce(AndroidVirtualDevice.MIN_ANDROID_VERSION);
149+
const bestVersion = best && best.version && semver.coerce(best.version);
150+
151+
return (bestVersion && semver.gte(bestVersion, minVersion)) ? best : null;
148152
}
149153

150154
private async waitForEmulatorBootToComplete(emulator: Mobile.IDeviceInfo, endTimeEpoch: number, timeout: number): Promise<{ runningEmulator: Mobile.IDeviceInfo, errors: string[] }> {

lib/common/mobile/emulator-helper.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { RUNNING_EMULATOR_STATUS, DeviceTypes } from "../constants";
33
export class EmulatorHelper implements Mobile.IEmulatorHelper {
44
// https://developer.android.com/guide/topics/manifest/uses-sdk-element
55
public mapAndroidApiLevelToVersion = {
6+
"android-29": "10.0.0",
67
"android-28": "9.0.0",
78
"android-27": "8.1.0",
89
"android-26": "8.0.0",

0 commit comments

Comments
 (0)