"use strict";
class LivesyncCommand {
    constructor($logger, $usbLiveSyncService, $mobileHelper, $options, $errors) {
        this.$logger = $logger;
        this.$usbLiveSyncService = $usbLiveSyncService;
        this.$mobileHelper = $mobileHelper;
        this.$options = $options;
        this.$errors = $errors;
        this.allowedParameters = [];
    }
    execute(args) {
        return this.$usbLiveSyncService.liveSync(args[0]);
    }
    canExecute(args) {
        return (() => {
            if (args.length >= 2) {
                this.$errors.fail("Invalid number of arguments.");
            }
            let platform = args[0];
            if (platform) {
                return _.includes(this.$mobileHelper.platformNames, this.$mobileHelper.normalizePlatformName(platform));
            }
            return true;
        }).future()();
    }
}
exports.LivesyncCommand = LivesyncCommand;
$injector.registerCommand("livesync", LivesyncCommand);
