Skip to content

Commit 1f84377

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Logcat printer
1 parent 859cf66 commit 1f84377

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

lib/bootstrap.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ $injector.require("optionsService", "./services/options-service");
4949
$injector.require("dynamicHelpProvider", "./dynamic-help-provider");
5050
$injector.require("mobilePlatformsCapabilities", "./mobile-platforms-capabilities");
5151
$injector.require("commandsServiceProvider", "./providers/commands-service-provider");
52+
53+
$injector.require("logcatPrinter", "./providers/logcat-printer");

lib/providers/logcat-printer.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
///<reference path="../.d.ts"/>
2+
"use strict";
3+
import Future = require("fibers/future");
4+
5+
export class LogcatPrinter implements Mobile.ILogcatPrinter {
6+
constructor(private $logger: ILogger) { }
7+
8+
public print(line: string): void {
9+
this.$logger.out(line);
10+
}
11+
12+
}
13+
$injector.register("logcatPrinter", LogcatPrinter);

lib/services/platform-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export class PlatformService implements IPlatformService {
1818
private $platformsData: IPlatformsData,
1919
private $projectData: IProjectData,
2020
private $projectDataService: IProjectDataService,
21-
private $prompter: IPrompter) { }
21+
private $prompter: IPrompter,
22+
private $commandsService: ICommandsService) { }
2223

2324
public addPlatforms(platforms: string[]): IFuture<void> {
2425
return (() => {
@@ -190,7 +191,6 @@ export class PlatformService implements IPlatformService {
190191
return (() => {
191192
platform = platform.toLowerCase();
192193

193-
this.preparePlatform(platform).wait();
194194
if (options.emulator) {
195195
this.deployOnEmulator(platform).wait();
196196
} else {
@@ -242,6 +242,7 @@ export class PlatformService implements IPlatformService {
242242
this.$devicesServices.initialize({platform: platform, deviceId: options.device}).wait();
243243
var action = (device: Mobile.IDevice): IFuture<void> => { return device.deploy(packageFile, this.$projectData.projectId); };
244244
this.$devicesServices.execute(action).wait();
245+
this.$commandsService.tryExecuteCommand("device", ["run"]).wait();
245246

246247
}).future<void>()();
247248
}

0 commit comments

Comments
 (0)