Skip to content

Commit aa21e90

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #665 from NativeScript/fatme/fix-livesync-to-android-emultor
Fix livesync on android emulator
2 parents 1e3b79d + 86d84e3 commit aa21e90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/services/usb-livesync-service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ export class AndroidUsbLiveSyncService extends androidLiveSyncServiceLib.Android
118118
let commandsFileDevicePath = this.$mobileHelper.buildDevicePath(deviceAppData.deviceProjectRootPath, AndroidUsbLiveSyncService.LIVESYNC_COMMANDS_FILE_NAME);
119119
this.createCommandsFileOnDevice(commandsFileDevicePath, commands).wait();
120120

121-
this.device.adb.executeShellCommand(`"cat ${commandsFileDevicePath} | run-as ${deviceAppData.appIdentifier}"`).wait();
121+
let result = this.device.adb.executeShellCommand(`"cat ${commandsFileDevicePath} | run-as ${deviceAppData.appIdentifier}"`).wait();
122+
if(result.indexOf("Permission denied") !== -1) {
123+
this.device.adb.executeShellCommand(`${commandsFileDevicePath}`).wait();
124+
}
122125
}
123126

124127
this.device.applicationManager.restartApplication(deviceAppData.appIdentifier).wait();

0 commit comments

Comments
 (0)