@@ -36,9 +36,9 @@ export class AndroidDeviceLiveSyncService extends DeviceLiveSyncServiceBase impl
36
36
`${ deviceProjectRootDirname } /sync` ]
37
37
) ;
38
38
39
- await this . reloadResources ( deviceAppData , localToDevicePaths ) ;
39
+ const reloadedSuccessfully = await this . reloadApplicationFiles ( deviceAppData , localToDevicePaths ) ;
40
40
41
- const canExecuteFastSync = ! liveSyncInfo . isFullSync && ! _ . some ( localToDevicePaths ,
41
+ const canExecuteFastSync = reloadedSuccessfully && ! liveSyncInfo . isFullSync && ! _ . some ( localToDevicePaths ,
42
42
( localToDevicePath : Mobile . ILocalToDevicePathData ) => ! this . canExecuteFastSync ( localToDevicePath . getLocalPath ( ) , projectData , this . device . deviceInfo . platform ) ) ;
43
43
44
44
if ( ! canExecuteFastSync ) {
@@ -84,14 +84,15 @@ export class AndroidDeviceLiveSyncService extends DeviceLiveSyncServiceBase impl
84
84
await this . cleanLivesyncDirectories ( deviceAppData ) ;
85
85
}
86
86
87
- private async reloadResources ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : Promise < void > {
87
+ private async reloadApplicationFiles ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : Promise < boolean > {
88
88
await this . device . adb . executeCommand ( [ "forward" , `tcp:${ AndroidDeviceLiveSyncService . BACKEND_PORT . toString ( ) } ` , `localabstract:${ deviceAppData . appIdentifier } -livesync` ] ) ;
89
89
90
- if ( await this . sendPageReloadMessage ( ) ) {
90
+ if ( await this . awaitRuntimeReloadSuccessMessage ( ) ) {
91
91
await this . cleanLivesyncDirectories ( deviceAppData ) ;
92
92
} else {
93
- await this . restartApplication ( deviceAppData ) ; //in case runtime socket error/close
93
+ return false ;
94
94
}
95
+ return true ;
95
96
}
96
97
97
98
public async removeFiles ( deviceAppData : Mobile . IDeviceAppData , localToDevicePaths : Mobile . ILocalToDevicePathData [ ] ) : Promise < void > {
@@ -115,7 +116,7 @@ export class AndroidDeviceLiveSyncService extends DeviceLiveSyncServiceBase impl
115
116
return this . $injector . resolve ( AndroidDeviceHashService , { adb, appIdentifier } ) ;
116
117
}
117
118
118
- private async sendPageReloadMessage ( ) : Promise < boolean > {
119
+ private async awaitRuntimeReloadSuccessMessage ( ) : Promise < boolean > {
119
120
return new Promise < boolean > ( ( resolve , reject ) => {
120
121
let isResolved = false ;
121
122
let socket = new net . Socket ( ) ;
0 commit comments