@@ -3,7 +3,7 @@ import { getCurrentEpochTime, sleep } from "../../helpers";
33import { EOL } from "os" ;
44import * as _ from "lodash" ;
55import { LoggerConfigData } from "../../../constants" ;
6- import { IChildProcess , IUtils } from "../../declarations" ;
6+ import { IChildProcess , IUserSettingsService , IUtils } from "../../declarations" ;
77import { injector } from "../../yok" ;
88import * as semver from "semver" ;
99
@@ -18,6 +18,7 @@ export class AndroidEmulatorServices
1818 private $emulatorHelper : Mobile . IEmulatorHelper ,
1919 private $logger : ILogger ,
2020 private $utils : IUtils ,
21+ private $userSettingsService : IUserSettingsService ,
2122 ) { }
2223
2324 public async getEmulatorImages ( ) : Promise < Mobile . IEmulatorImagesOutput > {
@@ -154,7 +155,7 @@ export class AndroidEmulatorServices
154155 } ;
155156 }
156157
157- this . spawnEmulator ( emulator ) ;
158+ await this . spawnEmulator ( emulator ) ;
158159
159160 const isInfiniteWait = this . $utils . getMilliSecondsTimeout ( timeout ) === 0 ;
160161 let hasTimeLeft = getCurrentEpochTime ( ) < endTimeEpoch ;
@@ -186,7 +187,7 @@ export class AndroidEmulatorServices
186187 }
187188 }
188189
189- private spawnEmulator ( emulator : Mobile . IDeviceInfo ) : void {
190+ private async spawnEmulator ( emulator : Mobile . IDeviceInfo ) {
190191 let pathToEmulatorExecutable = null ;
191192 let startEmulatorArgs = null ;
192193 if ( emulator . vendor === AndroidVirtualDevice . AVD_VENDOR_NAME ) {
@@ -195,6 +196,12 @@ export class AndroidEmulatorServices
195196 startEmulatorArgs = this . $androidVirtualDeviceService . startEmulatorArgs (
196197 emulator . imageIdentifier ,
197198 ) ;
199+ try {
200+ const additionalArgs = await this . $userSettingsService . getSettingValue < string [ ] > ( "androidEmulatorStartArgs" ) ;
201+ if ( additionalArgs ?. length ) {
202+ startEmulatorArgs . push ( ...additionalArgs ) ;
203+ }
204+ } catch ( error ) { }
198205 } else if (
199206 emulator . vendor === AndroidVirtualDevice . GENYMOTION_VENDOR_NAME
200207 ) {
0 commit comments