Skip to content

Commit 5b1141c

Browse files
author
Dimitar Kerezov
committed
Restart app upon debugging
1 parent f32f243 commit 5b1141c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/services/debug-service.ts

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export class DebugService extends EventEmitter implements IDebugService {
88
private $androidDebugService: IPlatformDebugService,
99
private $iOSDebugService: IPlatformDebugService,
1010
private $errors: IErrors,
11+
private $logger: ILogger,
1112
private $hostInfo: IHostInfo,
1213
private $mobileHelper: Mobile.IMobileHelper) {
1314
super();
@@ -29,6 +30,14 @@ export class DebugService extends EventEmitter implements IDebugService {
2930
this.$errors.failWithoutHelp(`The application ${debugData.applicationIdentifier} is not installed on device with identifier ${debugData.deviceIdentifier}.`);
3031
}
3132

33+
if (this.$mobileHelper.isiOSPlatform(device.deviceInfo.platform)) {
34+
try {
35+
await device.applicationManager.restartApplication(debugData.applicationIdentifier, debugData.projectName);
36+
} catch (err) {
37+
this.$logger.trace("Failed to restart app", err);
38+
}
39+
}
40+
3241
const debugOptions: IDebugOptions = _.merge({}, options);
3342
debugOptions.start = true;
3443

0 commit comments

Comments
 (0)