@@ -50,27 +50,23 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
5050 }
5151
5252 if ( debugOptions . emulator ) {
53- if ( debugOptions . debugBrk ) {
54- return [ await this . emulatorDebugBrk ( debugData , true , debugOptions ) ] ;
55- } else if ( debugOptions . start ) {
53+ if ( debugOptions . start ) {
5654 return [ await this . emulatorStart ( debugData , debugOptions ) ] ;
5755 } else {
58- return [ await this . emulatorDebugBrk ( debugData , false , debugOptions ) ] ;
56+ return [ await this . emulatorDebugBrk ( debugData , debugOptions ) ] ;
5957 }
6058 } else {
61- if ( debugOptions . debugBrk ) {
62- return this . deviceDebugBrk ( debugData , true , debugOptions ) ;
63- } else if ( debugOptions . start ) {
59+ if ( debugOptions . start ) {
6460 return this . deviceStart ( debugData , debugOptions ) ;
6561 } else {
66- return this . deviceDebugBrk ( debugData , false , debugOptions ) ;
62+ return this . deviceDebugBrk ( debugData , debugOptions ) ;
6763 }
6864 }
6965 }
7066
7167 public async debugStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < void > {
7268 await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
73- const action = async ( device : Mobile . IiOSDevice ) => await device . isEmulator ? this . emulatorDebugBrk ( debugData , false , debugOptions ) : this . debugBrkCore ( device , debugData , debugOptions ) ;
69+ const action = async ( device : Mobile . IiOSDevice ) => device . isEmulator ? await this . emulatorDebugBrk ( debugData , debugOptions ) : await this . debugBrkCore ( device , debugData , debugOptions ) ;
7470 await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
7571 }
7672
@@ -95,8 +91,8 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
9591 }
9692 }
9793
98- private async emulatorDebugBrk ( debugData : IDebugData , shouldBreak : boolean , debugOptions : IDebugOptions ) : Promise < string > {
99- let args = shouldBreak ? "--nativescript-debug-brk" : "--nativescript-debug-start" ;
94+ private async emulatorDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
95+ let args = debugOptions . debugBrk ? "--nativescript-debug-brk" : "--nativescript-debug-start" ;
10096 let child_process = await this . $iOSEmulatorServices . runApplicationOnEmulator ( debugData . pathToAppPackage , {
10197 waitForDebugger : true ,
10298 captureStdin : true ,
@@ -136,11 +132,11 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
136132 return result ;
137133 }
138134
139- private async deviceDebugBrk ( debugData : IDebugData , shouldBreak : boolean , debugOptions : IDebugOptions ) : Promise < string [ ] > {
135+ private async deviceDebugBrk ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string [ ] > {
140136 await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
141137 const action = async ( device : iOSDevice . IOSDevice ) => {
142138 if ( device . isEmulator ) {
143- return await this . emulatorDebugBrk ( debugData , shouldBreak , debugOptions ) ;
139+ return await this . emulatorDebugBrk ( debugData , debugOptions ) ;
144140 }
145141
146142 const runOptions : IRunPlatformOptions = {
@@ -151,27 +147,27 @@ class IOSDebugService extends DebugServiceBase implements IPlatformDebugService
151147 // we intentionally do not wait on this here, because if we did, we'd miss the AppLaunching notification
152148 let startApplicationAction = this . $platformService . startApplication ( this . platform , runOptions , debugData . applicationIdentifier ) ;
153149
154- const result = await this . debugBrkCore ( device , debugData , debugOptions , shouldBreak ) ;
150+ const result = await this . debugBrkCore ( device , debugData , debugOptions ) ;
155151
156152 await startApplicationAction ;
157153
158154 return result ;
159155 } ;
160156
161- const result = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
162- return _ . map ( result , r => r . result ) ;
157+ const results = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
158+ return _ . map ( results , r => r . result ) ;
163159 }
164160
165- private async debugBrkCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions , shouldBreak ?: boolean ) : Promise < string > {
166- await this . $iOSSocketRequestExecutor . executeLaunchRequest ( device . deviceInfo . identifier , TIMEOUT_SECONDS , TIMEOUT_SECONDS , debugData . applicationIdentifier , shouldBreak ) ;
161+ private async debugBrkCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
162+ await this . $iOSSocketRequestExecutor . executeLaunchRequest ( device . deviceInfo . identifier , TIMEOUT_SECONDS , TIMEOUT_SECONDS , debugData . applicationIdentifier , debugOptions . debugBrk ) ;
167163 return this . wireDebuggerClient ( debugData , debugOptions , device ) ;
168164 }
169165
170166 private async deviceStart ( debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string [ ] > {
171167 await this . $devicesService . initialize ( { platform : this . platform , deviceId : debugData . deviceIdentifier } ) ;
172168 const action = async ( device : Mobile . IiOSDevice ) => device . isEmulator ? await this . emulatorStart ( debugData , debugOptions ) : await this . deviceStartCore ( device , debugData , debugOptions ) ;
173- const result = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
174- return _ . map ( result , r => r . result ) ;
169+ const results = await this . $devicesService . execute ( action , this . getCanExecuteAction ( debugData . deviceIdentifier ) ) ;
170+ return _ . map ( results , r => r . result ) ;
175171 }
176172
177173 private async deviceStartCore ( device : Mobile . IiOSDevice , debugData : IDebugData , debugOptions : IDebugOptions ) : Promise < string > {
0 commit comments