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