AppBuilder-CLI wrong avd (android) image argument

2 posts, 0 answers
  1. Igal
    Igal avatar
    1 posts
    Member since:
    Jan 2014

    Posted 28 Sep 2014 Link to this post

    Hay, I tried using the AppBuilder-CLI on my Linux like this inside project directory:
    $ appbuilder emulate android

    got error image "cannot be found".

    so I looked into appbuilder code, specifically:

    and found this code:

    var EmulateAndroidCommand = (function () {
        function EmulateAndroidCommand($project, $projectTypes, $buildService, $androidEmulatorServices) {
            this.$project = $project;
            this.$projectTypes = $projectTypes;
            this.$buildService = $buildService;
            this.$androidEmulatorServices = $androidEmulatorServices;
        EmulateAndroidCommand.prototype.execute = function (args) {
            var _this = this;
            return (function () {

                var tempDir = _this.$project.getTempDir("emulatorfiles").wait();
                var packageFilePath = path.join(tempDir, "package.apk");
                var packageDefs = _this.${
                    platform: MobileHelper.DevicePlatforms[1 /* Android */],
                    configuration: "Debug",
                    showQrCodes: false,
                    downloadFiles: true,
                    downloadedFilePath: packageFilePath
                var image = args[1];
                var appId = AppIdentifier.createAppIdentifier(MobileHelper.DevicePlatforms[1 /* Android */], _this.$project.projectData.AppIdentifier, options.companion, _this.$project.projectType);
                _this.$androidEmulatorServices.startEmulator(packageFilePath, { image: image, appId: appId.appIdentifier }).wait();
        return EmulateAndroidCommand;

    looking ahead, it turn out the command I was looking for is actually:
    $ appbuilder emulate android Emu1

    but, my image is in args[0] not args[1].
    so I made the following change, var image = args[0]; and the correct emulator showed up running the same command.
    I will also note there's no documentation of this not in application help and not the Telerik site.
  2. Todor
    Todor avatar
    63 posts

    Posted 29 Sep 2014 Link to this post

    Hi Igal,

    The officially supported workflow for the CLI is to use only the default emulator.

    As you found out, however, there is code which slipped through and can be changed to support running on a particular emulator image. In its current state, this code is unfinished and that's why it is undocumented.

    Your change makes it work, but this is only a temporary measure. You can use it but we cannot guarantee its stability. We plan to implement this feature more thoroughly for our next release. If this happens, the feature will also be tested, fully supported and well documented.

    In the meantime, I would like to thank you for bringing it to our attention. As a small token of our gratitude I updated your Telerik points.


    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top