Skip to content

Commit 86d84e3

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Fix livesync on android emulator
1 parent 1e3b79d commit 86d84e3

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)