@@ -145,30 +145,30 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
145145 }
146146
147147 @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 > {
149149 const deviceDescriptor = this . getDeviceDescriptor ( liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier , projectData . projectDir ) ;
150150
151151 return deviceDescriptor && deviceDescriptor . debugggingEnabled ?
152152 this . refreshApplicationWithDebug ( projectData , liveSyncResultInfo , debugOpts , outputPath ) :
153153 this . refreshApplicationWithoutDebug ( projectData , liveSyncResultInfo , debugOpts , outputPath ) ;
154154 }
155155
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 } ;
158158 const platform = liveSyncResultInfo . deviceAppData . platform ;
159159 const platformLiveSyncService = this . getLiveSyncService ( platform ) ;
160160 const applicationIdentifier = projectData . projectIdentifiers [ platform . toLowerCase ( ) ] ;
161161 try {
162162 let shouldRestart = await platformLiveSyncService . shouldRestart ( projectData , liveSyncResultInfo ) ;
163163 if ( ! shouldRestart ) {
164- result . didRefresh = await platformLiveSyncService . tryRefreshApplication ( projectData , liveSyncResultInfo ) ;
165- shouldRestart = ! result . didRefresh ;
164+ shouldRestart = ! await platformLiveSyncService . tryRefreshApplication ( projectData , liveSyncResultInfo ) ;
166165 }
167166
168167 if ( shouldRestart ) {
169168 const deviceIdentifier = liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier ;
170169 this . emit ( DEBUGGER_DETACHED_EVENT_NAME , { deviceIdentifier } ) ;
171170 await platformLiveSyncService . restartApplication ( projectData , liveSyncResultInfo ) ;
171+ result . didRestart = true ;
172172 }
173173 } catch ( err ) {
174174 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
212212 // if we try to send the launch request, the debugger port will not be printed and the command will timeout
213213 debugOptions . start = ! debugOptions . debugBrk ;
214214
215- debugOptions . forceDebuggerAttachedEvent = ! refreshInfo . didRefresh ;
215+ debugOptions . forceDebuggerAttachedEvent = refreshInfo . didRestart ;
216216 const deviceOption = {
217217 deviceIdentifier : liveSyncResultInfo . deviceAppData . device . deviceInfo . identifier ,
218218 debugOptions : debugOptions ,
0 commit comments