diff --git a/docs/man_pages/project/testing/emulate-android.md b/docs/man_pages/project/testing/emulate-android.md index 40dff0f765..34bd0973cb 100644 --- a/docs/man_pages/project/testing/emulate-android.md +++ b/docs/man_pages/project/testing/emulate-android.md @@ -3,9 +3,9 @@ emulate android Usage | Synopsis ---|--- -Run in the native emulator | `$ tns emulate android [--avd ] [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` -Run in Genymotion | `$ tns emulate android --geny [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` -Run in the default Android virtual device or in a currently running emulator | `$ tns emulate android [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` +Run in the native emulator | `$ tns emulate android [--avd ] [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` +Run in Genymotion | `$ tns emulate android --geny [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` +Run in the default Android virtual device or in a currently running emulator | `$ tns emulate android [--path ] [--timeout ] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` Builds the specified project and runs it in the native emulator from the Android SDK or Genymotion. <% if(isHtml) { %>If you do not select an Android virtual device (AVD) with the `--avd` option or a Genymotion virtual device with the `--geny` option, your app runs in the default AVD or a currently running emulator, if any. <% } %> @@ -19,6 +19,7 @@ Builds the specified project and runs it in the native emulator from the Android * `--keyStorePassword` - Provides the password for the keystore file specified with --keyStorePath. You can use the `--keyStore*` options along with --release to produce a signed release build. You need to specify all `--keyStore*` options. * `--keyStoreAlias` - Provides the alias for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options. * `--keyStoreAliasPassword` - Provides the password for the alias specified with `--keStoreAliasPassword`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options. +* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console. ### Attributes * `` is the name of the Android virtual device that you want to use as listed by `$ android list avd` diff --git a/docs/man_pages/project/testing/run-android.md b/docs/man_pages/project/testing/run-android.md index d01ca8de90..c019b4c633 100644 --- a/docs/man_pages/project/testing/run-android.md +++ b/docs/man_pages/project/testing/run-android.md @@ -3,9 +3,9 @@ run android Usage | Synopsis ---|--- -Run on all connected devices and running emulators | `$ tns run android [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` -Run on a selected connected device or running emulator | `$ tns run android --device [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` -Start an emulator and run the app inside it | `$ tns run android --emulator [] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release]` +Run on all connected devices and running emulators | `$ tns run android [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` +Run on a selected connected device or running emulator | `$ tns run android --device [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` +Start an emulator and run the app inside it | `$ tns run android --emulator [] [--keyStorePath --keyStorePassword --keyStoreAlias --keyStoreAliasPassword ] [--release] [--justlaunch]` Runs your project on a connected Android device or in a native Android emulator, if configured. This is shorthand for prepare, build and deploy. @@ -17,6 +17,7 @@ Runs your project on a connected Android device or in a native Android emulator, * `--keyStorePassword` - Provides the password for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options. * `--keyStoreAlias` - Provides the alias for the keystore file specified with `--keyStorePath`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options. * `--keyStoreAliasPassword` - Provides the password for the alias specified with `--keStoreAliasPassword`. You can use the `--keyStore*` options along with `--release` to produce a signed release build. You need to specify all `--keyStore*` options. +* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console. ### Attributes * `` is the index or name of the target device as listed by `$ tns device android` diff --git a/docs/man_pages/project/testing/run-ios.md b/docs/man_pages/project/testing/run-ios.md index d964769155..79f4a4be14 100644 --- a/docs/man_pages/project/testing/run-ios.md +++ b/docs/man_pages/project/testing/run-ios.md @@ -3,8 +3,8 @@ run ios Usage | Synopsis ---|--- -Run on all connected devices | `$ tns run ios [--release]` -Run on a selected connected device | `$ tns run ios [--device ] [--release]` +Run on all connected devices | `$ tns run ios [--release] [--justlaunch]` +Run on a selected connected device | `$ tns run ios [--device ] [--release] [--justlaunch]` Start an emulator and run the app inside it | `$ tns run ios --emulator [] [--release]` Runs your project on a connected iOS device or in the iOS Simulator, if configured. This is shorthand for prepare, build, and deploy. @@ -17,6 +17,7 @@ Runs your project on a connected iOS device or in the iOS Simulator, if configur * `--device` - Specifies a connected device on which to run the app. * `--emulator` - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other valid combination of emulator options as listed by `$ tns help emulate ios`. You cannot use `--device` and `--emulator` simultaneously. * `--release` - If set, produces a release build. Otherwise, produces a debug build. +* `--justlaunch` - If set, does not print application output on the console. Otherwise prints the application output on the console. ### Attributes * `` is the index or name of the target device as listed by `$ tns device ios` diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index 1015e0a964..cb0549efa0 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -49,3 +49,5 @@ $injector.require("optionsService", "./services/options-service"); $injector.require("dynamicHelpProvider", "./dynamic-help-provider"); $injector.require("mobilePlatformsCapabilities", "./mobile-platforms-capabilities"); $injector.require("commandsServiceProvider", "./providers/commands-service-provider"); + +$injector.require("logcatPrinter", "./providers/logcat-printer"); diff --git a/lib/common b/lib/common index 257a9ab6e7..55c8fcc2f1 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 257a9ab6e76a9aa4a10792a0d3e66238a3fccd1e +Subproject commit 55c8fcc2f1f27be76974c40d3d01cb3229263134 diff --git a/lib/providers/logcat-printer.ts b/lib/providers/logcat-printer.ts new file mode 100644 index 0000000000..9c03309166 --- /dev/null +++ b/lib/providers/logcat-printer.ts @@ -0,0 +1,12 @@ +/// +"use strict"; + +export class LogcatPrinter implements Mobile.ILogcatPrinter { + constructor(private $logger: ILogger) { } + + public print(line: string): void { + this.$logger.out(line); + } + +} +$injector.register("logcatPrinter", LogcatPrinter); \ No newline at end of file diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 01ec4d4f1c..7723f05c65 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -18,7 +18,8 @@ export class PlatformService implements IPlatformService { private $platformsData: IPlatformsData, private $projectData: IProjectData, private $projectDataService: IProjectDataService, - private $prompter: IPrompter) { } + private $prompter: IPrompter, + private $commandsService: ICommandsService) { } public addPlatforms(platforms: string[]): IFuture { return (() => { @@ -190,7 +191,6 @@ export class PlatformService implements IPlatformService { return (() => { platform = platform.toLowerCase(); - this.preparePlatform(platform).wait(); if (options.emulator) { this.deployOnEmulator(platform).wait(); } else { @@ -242,7 +242,7 @@ export class PlatformService implements IPlatformService { this.$devicesServices.initialize({platform: platform, deviceId: options.device}).wait(); var action = (device: Mobile.IDevice): IFuture => { return device.deploy(packageFile, this.$projectData.projectId); }; this.$devicesServices.execute(action).wait(); - + this.$commandsService.tryExecuteCommand("device", ["run", this.$projectData.projectId]).wait(); }).future()(); } diff --git a/test/platform-commands.ts b/test/platform-commands.ts index 3634f36b09..6ac98ed6d7 100644 --- a/test/platform-commands.ts +++ b/test/platform-commands.ts @@ -99,7 +99,9 @@ function createTestInjector() { testInjector.register("commandsServiceProvider", { registerDynamicSubCommands: () => {} }); - + testInjector.register("commandsService", { + tryExecuteCommand: () => {} + }); return testInjector; } diff --git a/test/platform-service.ts b/test/platform-service.ts index 6b26925b3a..d4210c24a7 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -38,6 +38,9 @@ function createTestInjector() { testInjector.register('projectDataService', stubs.ProjectDataService); testInjector.register('prompter', {}); testInjector.register('lockfile', stubs.LockFile); + testInjector.register("commandsService", { + tryExecuteCommand: () => {} + }); return testInjector; }