Skip to content

Commit 139b4df

Browse files
Dimitar KerezovFatme
authored andcommitted
Fix device path on windows
1 parent 90b9aaa commit 139b4df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/services/usb-livesync-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import androidLiveSyncServiceLib = require("../common/mobile/android/android-livesync-service");
55
import usbLivesyncServiceBaseLib = require("../common/services/usb-livesync-service-base");
6+
import helpers = require("../common/helpers");
67
import path = require("path");
78

89
export class UsbLiveSyncService extends usbLivesyncServiceBaseLib.UsbLiveSyncServiceBase implements IUsbLiveSyncService {
@@ -80,13 +81,15 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
8081
let commands = [ this.liveSyncCommands.SyncFilesCommand() ];
8182
this.livesync(deviceAppData.appIdentifier, deviceAppData.deviceProjectRootPath, commands).wait();
8283
} else {
83-
this.device.adb.executeShellCommand(`chmod 0777 ${path.join(deviceAppData.deviceProjectRootPath, "app")}`).wait();
84+
// TODO: Introduce this.$mobileHelper.correctDevicePath(path: string) { return helpers.stringReplaceAll(path), '\\', '/') }
85+
// Then later on this.$mobileHelper.buildDevicePath should call `correctDevicePath` before returning the output
86+
this.device.adb.executeShellCommand(`chmod 0777 ${this.$mobileHelper.buildDevicePath(deviceAppData.deviceProjectRootPath, "app")}`).wait();
8487

8588
let commands: string[] = [];
8689

8790
let devicePathRoot = `/data/data/${deviceAppData.appIdentifier}/files`;
8891
_.each(localToDevicePaths, localToDevicePath => {
89-
let devicePath = path.join(devicePathRoot, localToDevicePath.getRelativeToProjectBasePath());
92+
let devicePath = helpers.stringReplaceAll(path.join(devicePathRoot, localToDevicePath.getRelativeToProjectBasePath()), '\\', '/');
9093
//commands.push(`ls "${path.dirname(devicePath)}" >/dev/null 2>/dev/null || mkdir "${path.dirname(devicePath)}"`);
9194
commands.push(`mv "${localToDevicePath.getDevicePath()}" "${devicePath}"`);
9295
});

0 commit comments

Comments
 (0)