UNPKG

mobile-cli-lib

Version:
67 lines (66 loc) 2.8 kB
"use strict"; var applicationManagerPath = require("./ios-simulator-application-manager"); var fileSystemPath = require("./ios-simulator-file-system"); var constants = require("../../../constants"); var IOSSimulator = (function () { function IOSSimulator(simulator, $devicePlatformsConstants, $injector, $iOSSimResolver, $iOSSimulatorLogProvider) { this.simulator = simulator; this.$devicePlatformsConstants = $devicePlatformsConstants; this.$injector = $injector; this.$iOSSimResolver = $iOSSimResolver; this.$iOSSimulatorLogProvider = $iOSSimulatorLogProvider; } Object.defineProperty(IOSSimulator.prototype, "deviceInfo", { get: function () { return { identifier: this.simulator.id, displayName: this.simulator.name, model: _.last(this.simulator.fullId.split(".")), version: this.simulator.runtimeVersion, vendor: "Apple", platform: this.$devicePlatformsConstants.iOS, status: constants.CONNECTED_STATUS, errorHelp: null, isTablet: this.simulator.fullId.toLowerCase().indexOf("ipad") !== -1, type: "Emulator" }; }, enumerable: true, configurable: true }); Object.defineProperty(IOSSimulator.prototype, "isEmulator", { get: function () { return true; }, enumerable: true, configurable: true }); IOSSimulator.prototype.getApplicationInfo = function (applicationIdentifier) { return this.applicationManager.getApplicationInfo(applicationIdentifier); }; Object.defineProperty(IOSSimulator.prototype, "applicationManager", { get: function () { if (!this._applicationManager) { this._applicationManager = this.$injector.resolve(applicationManagerPath.IOSSimulatorApplicationManager, { iosSim: this.$iOSSimResolver.iOSSim, identifier: this.simulator.id }); } return this._applicationManager; }, enumerable: true, configurable: true }); Object.defineProperty(IOSSimulator.prototype, "fileSystem", { get: function () { if (!this._fileSystem) { this._fileSystem = this.$injector.resolve(fileSystemPath.IOSSimulatorFileSystem, { iosSim: this.$iOSSimResolver.iOSSim, identifier: this.simulator.id }); } return this._fileSystem; }, enumerable: true, configurable: true }); IOSSimulator.prototype.openDeviceLogStream = function () { this.$iOSSimulatorLogProvider.startLogProcess(this.simulator.id); }; return IOSSimulator; }()); exports.IOSSimulator = IOSSimulator;