diff --git a/lib/services/livesync/android-device-livesync-service.ts b/lib/services/livesync/android-device-livesync-service.ts index d5f7da18ee..0f86b1e390 100644 --- a/lib/services/livesync/android-device-livesync-service.ts +++ b/lib/services/livesync/android-device-livesync-service.ts @@ -67,11 +67,12 @@ class AndroidLiveSyncService implements INativeScriptDeviceLiveSyncService { public async removeFiles(appIdentifier: string, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectId: string): Promise { let deviceRootPath = this.getDeviceRootPath(appIdentifier); - _.each(localToDevicePaths, localToDevicePathData => { + + for (let localToDevicePathData of localToDevicePaths) { let relativeUnixPath = _.trimStart(helpers.fromWindowsRelativePathToUnix(localToDevicePathData.getRelativeToProjectBasePath()), "/"); let deviceFilePath = this.$mobileHelper.buildDevicePath(deviceRootPath, "removedsync", relativeUnixPath); - this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), "&& await ", "touch", deviceFilePath]); - }); + await this.device.adb.executeShellCommand(["mkdir", "-p", path.dirname(deviceFilePath), " && ", "touch", deviceFilePath]); + } await this.getDeviceHashService(projectId).removeHashes(localToDevicePaths); }