1
1
export class EmulateCommandBase {
2
- constructor ( private $platformService : IPlatformService ) { }
2
+ constructor ( private $options : IOptions ,
3
+ private $platformService : IPlatformService ) { }
3
4
4
5
public async executeCore ( args : string [ ] ) : Promise < void > {
5
- return this . $platformService . emulatePlatform ( args [ 0 ] ) ;
6
+ this . $options . emulator = true ;
7
+ const appFilesUpdaterOptions : IAppFilesUpdaterOptions = { bundle : this . $options . bundle , release : this . $options . release } ;
8
+ const emulateOptions : IEmulatePlatformOptions = {
9
+ avd : this . $options . avd ,
10
+ clean : this . $options . clean ,
11
+ device : this . $options . device ,
12
+ release : this . $options . release ,
13
+ emulator : this . $options . emulator ,
14
+ projectDir : this . $options . path ,
15
+ justlaunch : this . $options . justlaunch ,
16
+ availableDevices : this . $options . availableDevices ,
17
+ platformTemplate : this . $options . platformTemplate
18
+ }
19
+ return this . $platformService . emulatePlatform ( args [ 0 ] , appFilesUpdaterOptions , emulateOptions ) ;
6
20
}
7
21
}
8
22
9
23
export class EmulateIosCommand extends EmulateCommandBase implements ICommand {
10
24
public allowedParameters : ICommandParameter [ ] = [ ] ;
11
25
12
- constructor ( $platformService : IPlatformService ,
26
+ constructor ( $options : IOptions ,
27
+ $platformService : IPlatformService ,
13
28
private $platformsData : IPlatformsData ) {
14
- super ( $platformService ) ;
29
+ super ( $options , $ platformService) ;
15
30
}
16
31
17
32
public async execute ( args : string [ ] ) : Promise < void > {
@@ -22,9 +37,10 @@ export class EmulateIosCommand extends EmulateCommandBase implements ICommand {
22
37
$injector . registerCommand ( "emulate|ios" , EmulateIosCommand ) ;
23
38
24
39
export class EmulateAndroidCommand extends EmulateCommandBase implements ICommand {
25
- constructor ( $platformService : IPlatformService ,
40
+ constructor ( $options : IOptions ,
41
+ $platformService : IPlatformService ,
26
42
private $platformsData : IPlatformsData ) {
27
- super ( $platformService ) ;
43
+ super ( $options , $ platformService) ;
28
44
}
29
45
30
46
public allowedParameters : ICommandParameter [ ] = [ ] ;
0 commit comments