ios-sim-portable
Advanced tools
Comparing version 1.0.2 to 1.0.3
#!/usr/bin/env node | ||
require("../lib/ios-sim.js"); |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path=".././.d.ts"/> |
///<reference path="./.d.ts"/> | ||
"use strict"; | ||
//# sourceMappingURL=declarations.js.map |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ // Type definitions for node-fibers |
@@ -0,0 +0,0 @@ /************************************************ |
@@ -0,0 +0,0 @@ declare module "NodObjC" { |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -7,2 +7,3 @@ ///<reference path="./.d.ts"/> | ||
var util = require("util"); | ||
var os = require("os"); | ||
var $ = require("NodObjC"); | ||
@@ -16,3 +17,26 @@ | ||
get: function () { | ||
return XCode6Simulator.allowedDeviceIdentifiers; | ||
var simDeviceSet = $.classDefinition.getClassByName("SimDeviceSet"); | ||
var devicesInfo = []; | ||
if (simDeviceSet) { | ||
var deviceSet = simDeviceSet("defaultSet"); | ||
var devices = deviceSet("availableDevices"); | ||
var count = devices("count"); | ||
for (var index = 0; index < count; index++) { | ||
var device = devices("objectAtIndex", index); | ||
var deviceIdentifier = device("deviceType")("identifier").toString(); | ||
var deviceIdentifierPrefixIndex = deviceIdentifier.indexOf(XCode6Simulator.DEFAULT_DEVICE_IDENTIFIER); | ||
var deviceIdentifierWithoutPrefix = deviceIdentifier.substring(deviceIdentifierPrefixIndex + XCode6Simulator.DEVICE_IDENTIFIER_PREFIX.length + 2); | ||
var runtimeVersion = device("runtime")("versionString").toString(); | ||
var deviceInfo = [ | ||
util.format("Device Identifier: %s", deviceIdentifierWithoutPrefix), | ||
util.format("Runtime Version: %s", runtimeVersion)].join(os.EOL); | ||
devicesInfo.push(deviceInfo + os.EOL); | ||
} | ||
} | ||
return devicesInfo; | ||
}, | ||
@@ -72,15 +96,2 @@ enumerable: true, | ||
XCode6Simulator.DEFAULT_DEVICE_IDENTIFIER = "iPhone-4s"; | ||
XCode6Simulator.allowedDeviceIdentifiers = [ | ||
"iPhone-4s", | ||
"iPhone-5", | ||
"iPhone-5s", | ||
"iPhone-6", | ||
"iPhone-6-Plus", | ||
"Resizable-iPhone", | ||
"iPad-2", | ||
"iPad-Retina", | ||
"iPad-Air", | ||
"Resizable-iPad" | ||
]; | ||
return XCode6Simulator; | ||
@@ -87,0 +98,0 @@ })(); |
@@ -0,0 +0,0 @@ ///<reference path="./.d.ts"/> |
@@ -136,3 +136,13 @@ ///<reference path="./.d.ts"/> | ||
var sessionError = new Buffer(""); | ||
var time = $.NSNumber("numberWithDouble", 30); | ||
var timeoutParam = iPhoneSimulator.DEFAULT_TIMEOUT_IN_SECONDS; | ||
if (options.timeout || options.timeout === 0) { | ||
var parsedValue = parseInt(options.timeout); | ||
if (!isNaN(parsedValue) && parsedValue > 0) { | ||
timeoutParam = parsedValue; | ||
} else { | ||
console.log(util.format("Specify the timeout in number of seconds to wait. It should be greater than 0. Default value %s seconds will be used.", iPhoneSimulator.DEFAULT_TIMEOUT_IN_SECONDS.toString())); | ||
} | ||
} | ||
var time = $.NSNumber("numberWithDouble", timeoutParam); | ||
var timeout = time("doubleValue"); | ||
@@ -243,2 +253,4 @@ | ||
iPhoneSimulator.SIMULATOR_FRAMEWORK_RELATIVE_PATH = "../SharedFrameworks/DVTiPhoneSimulatorRemoteClient.framework"; | ||
iPhoneSimulator.DEFAULT_TIMEOUT_IN_SECONDS = 90; | ||
return iPhoneSimulator; | ||
@@ -245,0 +257,0 @@ })(); |
@@ -30,2 +30,4 @@ ///<reference path="./.d.ts"/> | ||
private static DEFAULT_TIMEOUT_IN_SECONDS = 90; | ||
public run(appPath: string): IFuture<void> { | ||
@@ -137,3 +139,14 @@ if(!fs.existsSync(appPath)) { | ||
var sessionError: any = new Buffer(""); | ||
var time = $.NSNumber("numberWithDouble", 30); | ||
var timeoutParam = iPhoneSimulator.DEFAULT_TIMEOUT_IN_SECONDS; | ||
if (options.timeout || options.timeout === 0) { | ||
var parsedValue = parseInt(options.timeout); | ||
if(!isNaN(parsedValue) && parsedValue > 0) { | ||
timeoutParam = parsedValue; | ||
} | ||
else { | ||
console.log(util.format("Specify the timeout in number of seconds to wait. It should be greater than 0. Default value %s seconds will be used.", iPhoneSimulator.DEFAULT_TIMEOUT_IN_SECONDS.toString())); | ||
} | ||
} | ||
var time = $.NSNumber("numberWithDouble", timeoutParam); | ||
var timeout = time("doubleValue"); | ||
@@ -140,0 +153,0 @@ |
@@ -13,2 +13,3 @@ ///<reference path=".d.ts"/> | ||
"args": String, | ||
"timeout": String, | ||
"help": Boolean | ||
@@ -15,0 +16,0 @@ }; |
@@ -14,2 +14,3 @@ ///<reference path=".d.ts"/> | ||
"args": String, | ||
"timeout": String, | ||
"help": Boolean | ||
@@ -16,0 +17,0 @@ }; |
@@ -0,0 +0,0 @@ function stringify(arr, delimiter) { |
@@ -0,0 +0,0 @@ export function stringify(arr: string[], delimiter?: string): string { |
{ | ||
"name": "ios-sim-portable", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ios-sim.js", |
@@ -0,0 +0,0 @@ var fs = require("fs"); |
@@ -0,0 +0,0 @@ ios-sim-portable |
@@ -0,0 +0,0 @@ --[]-- |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
38
4863
186008