@@ -38,7 +38,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
38
38
if ( await this . shouldTransferAllFiles ( platform , deviceAppData ) ) {
39
39
localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData , projectFilesPath , null , this . liveSyncData . excludedProjectDirsAndFiles ) ;
40
40
await this . transferFiles ( deviceAppData , localToDevicePaths , this . liveSyncData . projectFilesPath , true ) ;
41
- await device . fileSystem . putFile ( this . $projectChangesService . getPrepareInfoFilePath ( platform ) , await this . getLiveSyncInfoFilePath ( deviceAppData ) ) ;
41
+ await device . fileSystem . putFile ( this . $projectChangesService . getPrepareInfoFilePath ( platform ) , await this . getLiveSyncInfoFilePath ( deviceAppData ) , appIdentifier ) ;
42
42
}
43
43
44
44
if ( postAction ) {
@@ -160,12 +160,14 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
160
160
let deviceAppData : Mobile . IDeviceAppData = null ;
161
161
let localToDevicePaths : Mobile . ILocalToDevicePathData [ ] = null ;
162
162
let isFullSync = false ;
163
+
163
164
if ( this . $options . clean || this . $projectChangesService . currentChanges . changesRequireBuild ) {
164
165
let buildConfig : IBuildConfig = { buildForDevice : ! device . isEmulator } ;
165
166
let platform = device . deviceInfo . platform ;
166
167
if ( this . $platformService . shouldBuild ( platform , buildConfig ) ) {
167
168
await this . $platformService . buildPlatform ( platform , buildConfig ) ;
168
169
}
170
+
169
171
await this . $platformService . installApplication ( device ) ;
170
172
deviceAppData = this . $deviceAppDataFactory . create ( this . liveSyncData . appIdentifier , this . $mobileHelper . normalizePlatformName ( this . liveSyncData . platform ) , device ) ;
171
173
isFullSync = true ;
@@ -175,11 +177,15 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
175
177
localToDevicePaths = await this . $projectFilesManager . createLocalToDevicePaths ( deviceAppData , this . liveSyncData . projectFilesPath , mappedFiles , this . liveSyncData . excludedProjectDirsAndFiles ) ;
176
178
await fileSyncAction ( deviceAppData , localToDevicePaths ) ;
177
179
}
180
+
178
181
if ( ! afterFileSyncAction ) {
179
182
await this . refreshApplication ( deviceAppData , localToDevicePaths , isFullSync ) ;
180
183
}
181
- await device . fileSystem . putFile ( this . $projectChangesService . getPrepareInfoFilePath ( device . deviceInfo . platform ) , await this . getLiveSyncInfoFilePath ( deviceAppData ) ) ;
184
+
185
+ await device . fileSystem . putFile ( this . $projectChangesService . getPrepareInfoFilePath ( device . deviceInfo . platform ) , await this . getLiveSyncInfoFilePath ( deviceAppData ) , this . liveSyncData . appIdentifier ) ;
186
+
182
187
await this . finishLivesync ( deviceAppData ) ;
188
+
183
189
if ( afterFileSyncAction ) {
184
190
await afterFileSyncAction ( deviceAppData , localToDevicePaths ) ;
185
191
}
@@ -203,11 +209,7 @@ export abstract class PlatformLiveSyncServiceBase implements IPlatformLiveSyncSe
203
209
}
204
210
205
211
private async getLiveSyncInfoFilePath ( deviceAppData : Mobile . IDeviceAppData ) : Promise < string > {
206
- let deviceRootPath = await deviceAppData . getDeviceProjectRootPath ( ) ;
207
- if ( deviceAppData . device . deviceInfo . platform . toLowerCase ( ) === this . $devicePlatformsConstants . Android . toLowerCase ( ) ) {
208
- deviceRootPath = path . dirname ( deviceRootPath ) ;
209
- }
210
-
212
+ let deviceRootPath = path . dirname ( await deviceAppData . getDeviceProjectRootPath ( ) ) ;
211
213
let deviceFilePath = path . join ( deviceRootPath , livesyncInfoFileName ) ;
212
214
return deviceFilePath ;
213
215
}
0 commit comments