@@ -152,30 +152,30 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
152
152
}
153
153
154
154
@performanceLog ( )
155
- private async refreshApplication ( projectData : IProjectData , liveSyncResultInfo : ILiveSyncResultInfo , debugOpts ?: IDebugOptions , outputPath ?: string ) : Promise < IRefreshApplicationInfo | IDebugInformation > {
155
+ private async refreshApplication ( projectData : IProjectData , liveSyncResultInfo : ILiveSyncResultInfo , debugOpts ?: IDebugOptions , outputPath ?: string ) : Promise < IRestartApplicationInfo | IDebugInformation > {
156
156
const deviceDescriptor = this . getDeviceDescriptor ( liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier , projectData . projectDir ) ;
157
157
158
158
return deviceDescriptor && deviceDescriptor . debugggingEnabled ?
159
159
this . refreshApplicationWithDebug ( projectData , liveSyncResultInfo , debugOpts , outputPath ) :
160
160
this . refreshApplicationWithoutDebug ( projectData , liveSyncResultInfo , debugOpts , outputPath ) ;
161
161
}
162
162
163
- private async refreshApplicationWithoutDebug ( projectData : IProjectData , liveSyncResultInfo : ILiveSyncResultInfo , debugOpts ?: IDebugOptions , outputPath ?: string , settings ?: IRefreshApplicationSettings ) : Promise < IRefreshApplicationInfo > {
164
- const result = { didRefresh : false } ;
163
+ private async refreshApplicationWithoutDebug ( projectData : IProjectData , liveSyncResultInfo : ILiveSyncResultInfo , debugOpts ?: IDebugOptions , outputPath ?: string , settings ?: IRefreshApplicationSettings ) : Promise < IRestartApplicationInfo > {
164
+ const result = { didRestart : false } ;
165
165
const platform = liveSyncResultInfo . deviceAppData . platform ;
166
166
const platformLiveSyncService = this . getLiveSyncService ( platform ) ;
167
167
const applicationIdentifier = projectData . projectIdentifiers [ platform . toLowerCase ( ) ] ;
168
168
try {
169
169
let shouldRestart = await platformLiveSyncService . shouldRestart ( projectData , liveSyncResultInfo ) ;
170
170
if ( ! shouldRestart ) {
171
- result . didRefresh = await platformLiveSyncService . tryRefreshApplication ( projectData , liveSyncResultInfo ) ;
172
- shouldRestart = ! result . didRefresh ;
171
+ shouldRestart = ! await platformLiveSyncService . tryRefreshApplication ( projectData , liveSyncResultInfo ) ;
173
172
}
174
173
175
174
if ( shouldRestart ) {
176
175
const deviceIdentifier = liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier ;
177
176
this . emit ( DEBUGGER_DETACHED_EVENT_NAME , { deviceIdentifier } ) ;
178
177
await platformLiveSyncService . restartApplication ( projectData , liveSyncResultInfo ) ;
178
+ result . didRestart = true ;
179
179
}
180
180
} catch ( err ) {
181
181
this . $logger . info ( `Error while trying to start application ${ applicationIdentifier } on device ${ liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier } . Error is: ${ err . message || err } ` ) ;
@@ -219,7 +219,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
219
219
// if we try to send the launch request, the debugger port will not be printed and the command will timeout
220
220
debugOptions . start = ! debugOptions . debugBrk ;
221
221
222
- debugOptions . forceDebuggerAttachedEvent = ! refreshInfo . didRefresh ;
222
+ debugOptions . forceDebuggerAttachedEvent = refreshInfo . didRestart ;
223
223
const deviceOption = {
224
224
deviceIdentifier : liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier ,
225
225
debugOptions : debugOptions ,
0 commit comments