@@ -21,9 +21,9 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
21
21
private _childProcess : ChildProcess ;
22
22
private _socketProxy : any ;
23
23
24
- constructor ( private $platformService : IPlatformService ,
24
+ constructor ( protected $devicesService : Mobile . IDevicesService ,
25
+ private $platformService : IPlatformService ,
25
26
private $iOSEmulatorServices : Mobile . IEmulatorPlatformServices ,
26
- private $devicesService : Mobile . IDevicesService ,
27
27
private $childProcess : IChildProcess ,
28
28
private $logger : ILogger ,
29
29
private $errors : IErrors ,
@@ -32,7 +32,7 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
32
32
private $iOSSocketRequestExecutor : IiOSSocketRequestExecutor ,
33
33
private $processService : IProcessService ,
34
34
private $socketProxyFactory : ISocketProxyFactory ) {
35
- super ( ) ;
35
+ super ( $devicesService ) ;
36
36
this . $processService . attachToProcessExitSignals ( this , this . debugStop ) ;
37
37
this . $socketProxyFactory . on ( CONNECTION_ERROR_EVENT_NAME , ( e : Error ) => this . emit ( CONNECTION_ERROR_EVENT_NAME , e ) ) ;
38
38
}
@@ -41,7 +41,7 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
41
41
return "ios" ;
42
42
}
43
43
44
- public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string [ ] > {
44
+ public async debug ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
45
45
if ( debugOptions . debugBrk && debugOptions . start ) {
46
46
this . $errors . failWithoutHelp ( "Expected exactly one of the --debug-brk or --start options." ) ;
47
47
}
@@ -52,9 +52,9 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
52
52
53
53
if ( debugOptions . emulator ) {
54
54
if ( debugOptions . start ) {
55
- return [ await this . emulatorStart ( debugData , debugOptions ) ] ;
55
+ return await this . emulatorStart ( debugData , debugOptions ) ;
56
56
} else {
57
- return [ await this . emulatorDebugBrk ( debugData , debugOptions ) ] ;
57
+ return await this . emulatorDebugBrk ( debugData , debugOptions ) ;
58
58
}
59
59
} else {
60
60
if ( debugOptions . start ) {
@@ -149,7 +149,7 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
149
149
return result ;
150
150
}
151
151
152
- private async deviceDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string [ ] > {
152
+ private async deviceDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
153
153
await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
154
154
const action = async ( device : iOSDevice . IOSDevice ) => {
155
155
if ( device . isEmulator ) {
@@ -171,20 +171,20 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
171
171
return result ;
172
172
} ;
173
173
174
- const results = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
175
- return _ . map ( results , r => r . result ) ;
174
+ const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
175
+ return deviceActionResult [ 0 ] . result ;
176
176
}
177
177
178
178
private async debugBrkCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
179
179
await this . $iOSSocketRequestExecutor . executeLaunchRequest ( device . deviceInfo . identifier , TIMEOUT_SECONDS , TIMEOUT_SECONDS , debugData . applicationIdentifier , debugOptions . debugBrk ) ;
180
180
return this . wireDebuggerClient ( debugData , debugOptions , device ) ;
181
181
}
182
182
183
- private async deviceStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string [ ] > {
183
+ private async deviceStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
184
184
await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
185
185
const action = async ( device : Mobile . IiOSDevice ) => device . isEmulator ? await this . emulatorStart ( debugData , debugOptions ) : await this . deviceStartCore ( device , debugData , debugOptions ) ;
186
- const results = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
187
- return _ . map ( results , r => r . result ) ;
186
+ const deviceActionResult = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
187
+ return deviceActionResult [ 0 ] . result ;
188
188
}
189
189
190
190
private async deviceStartCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
0 commit comments