Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 36ddbba

Browse files
Merge pull request #598 from telerik/vladimirov/ios-sim-logging
Print iOS Simulator device logs
2 parents d323189 + aa34826 commit 36ddbba

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mobile/ios/simulator/ios-simulator-application-manager.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import Future = require("fibers/future");
66

77
export class IOSSimulatorApplicationManager extends ApplicationManagerBase implements Mobile.IDeviceApplicationManager {
88
constructor(private iosSim: any,
9-
private identifier: string) {
9+
private identifier: string,
10+
private $options: ICommonOptions) {
1011
super();
1112
}
1213

14+
private deviceLoggingStarted = false;
15+
1316
public getInstalledApplications(): IFuture<string[]> {
1417
return Future.fromResult(this.iosSim.getInstalledApplications(this.identifier));
1518
}
@@ -23,7 +26,14 @@ export class IOSSimulatorApplicationManager extends ApplicationManagerBase imple
2326
}
2427

2528
public startApplication(appIdentifier: string): IFuture<void> {
26-
return this.iosSim.startApplication(this.identifier, appIdentifier);
29+
return (() => {
30+
let launchResult = this.iosSim.startApplication(this.identifier, appIdentifier).wait();
31+
if (!this.$options.justlaunch && !this.deviceLoggingStarted) {
32+
this.deviceLoggingStarted = true;
33+
this.iosSim.printDeviceLog(this.identifier, launchResult);
34+
}
35+
36+
}).future<void>()();
2737
}
2838

2939
public stopApplication(cfBundleExecutable: string): IFuture<void> {

0 commit comments

Comments
 (0)