Repository: cordova-ios Updated Branches: refs/heads/master 571c23516 -> 8e74760ab
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/ls.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/ls.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/ls.js new file mode 100644 index 0000000..3345db4 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/ls.js @@ -0,0 +1,126 @@ +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options ,] path [,path ...]) +//@ ### ls([options ,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ``` +//@ +//@ Returns array of files in the given path, or in current directory if no path provided. +function _ls(options, paths) { + options = common.parseOptions(options, { + 'R': 'recursive', + 'A': 'all', + 'a': 'all_deprecated' + }); + + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) + paths = ['.']; + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + // Conditionally pushes file to list - returns true if pushed, false otherwise + // (e.g. prevents hidden files to be included unless explicitly told so) + function pushFile(file, query) { + // hidden file? + if (path.basename(file)[0] === '.') { + // not explicitly asking for hidden files? + if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) + return false; + } + + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = fs.statSync(p); + // Simple file? + if (stats.isFile()) { + pushFile(p, p); + return; // continue + } + + // Simple dir? + if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); + _cd('', oldDir); + } + }); + return; // continue + } + } + + // p does not exist - possible wildcard present + + var basename = path.basename(p); + var dirname = path.dirname(p); + // Wildcard present on an existing dir? (e.g. '/tmp/*.js') + if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { + // Escape special regular expression chars + var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); + // Translates wildcard into regex + regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; + // Iterate over directory contents + fs.readdirSync(dirname).forEach(function(file) { + if (file.match(new RegExp(regexp))) { + if (!pushFile(path.normalize(dirname+'/'+file), basename)) + return; + + // Recursive? + if (options.recursive) { + var pp = dirname + '/' + file; + if (fs.lstatSync(pp).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); + } // recursive + } // if file matches + }); // forEach + return; + } + + common.error('no such file or directory: ' + p, true); + }); + + return list; +} +module.exports = _ls; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mkdir.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mkdir.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mkdir.js new file mode 100644 index 0000000..5a7088f --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mkdir.js @@ -0,0 +1,68 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Recursively creates 'dir' +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options ,] dir [, dir ...]) +//@ ### mkdir([options ,] dir_array) +//@ Available options: +//@ +//@ + `p`: full path (will create intermediate dirs if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + options = common.parseOptions(options, { + 'p': 'fullpath' + }); + if (!dirs) + common.error('no paths given'); + + if (typeof dirs === 'string') + dirs = [].slice.call(arguments, 1); + // if it's array leave it as it is + + dirs.forEach(function(dir) { + if (fs.existsSync(dir)) { + if (!options.fullpath) + common.error('path already exists: ' + dir, true); + return; // skip dir + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, true); + return; // skip dir + } + + if (options.fullpath) + mkdirSyncRecursive(dir); + else + fs.mkdirSync(dir, parseInt('0777', 8)); + }); +} // mkdir +module.exports = _mkdir; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mv.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mv.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mv.js new file mode 100644 index 0000000..11f9607 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/mv.js @@ -0,0 +1,80 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv(source [, source ...], dest') +//@ ### mv(source_array, dest') +//@ Available options: +//@ +//@ + `f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-f', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves files. The wildcard `*` is accepted. +function _mv(options, sources, dest) { + options = common.parseOptions(options, { + 'f': 'force' + }); + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing <source> and/or <dest>'); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + sources = common.expand(sources); + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && !options.force) + common.error('dest file already exists: ' + dest); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && !options.force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: '+src, true); + return; // skip file + } + + fs.renameSync(src, thisDest); + }); // forEach(src) +} // mv +module.exports = _mv; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/popd.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/popd.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/popd.js new file mode 100644 index 0000000..11ea24f --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/popd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pushd.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pushd.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pushd.js new file mode 100644 index 0000000..11ea24f --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pushd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pwd.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pwd.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pwd.js new file mode 100644 index 0000000..41727bb --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/pwd.js @@ -0,0 +1,11 @@ +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### pwd() +//@ Returns the current directory. +function _pwd(options) { + var pwd = path.resolve(process.cwd()); + return common.ShellString(pwd); +} +module.exports = _pwd; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/rm.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/rm.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/rm.js new file mode 100644 index 0000000..3abe6e1 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/rm.js @@ -0,0 +1,145 @@ +var common = require('./common'); +var fs = require('fs'); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for(var i = 0; i < files.length; i++) { + var file = dir + "/" + files[i], + currFile = fs.lstatSync(file); + + if(currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } + + else if(currFile.isSymbolicLink()) { // Unlink symlinks + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + else // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + result = fs.rmdirSync(dir); + } catch(e) { + common.error('could not remove directory (code '+e.code+'): ' + dir, true); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch(e) { + writePermission = false; + } + + return writePermission; +} + +//@ +//@ ### rm([options ,] file [, file ...]) +//@ ### rm([options ,] file_array) +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. The wildcard `*` is accepted. +function _rm(options, files) { + options = common.parseOptions(options, { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive' + }); + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) { + // Path does not exist, no force flag given + if (!options.force) + common.error('no such file or directory: '+file, true); + + return; // skip file + } + + // If here, path exists + + var stats = fs.lstatSync(file); + if (stats.isFile() || stats.isSymbolicLink()) { + + // Do not check for file writing permissions + if (options.force) { + common.unlinkSync(file); + return; + } + + if (isWriteable(file)) + common.unlinkSync(file); + else + common.error('permission denied: '+file, true); + + return; + } // simple file + + // Path is an existing directory, but no -r flag given + if (stats.isDirectory() && !options.recursive) { + common.error('path is a directory', true); + return; // skip path + } + + // Recursively remove existing directory + if (stats.isDirectory() && options.recursive) { + rmdirSyncRecursive(file, options.force); + } + }); // forEach(file) +} // rm +module.exports = _rm; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/sed.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/sed.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/sed.js new file mode 100644 index 0000000..9783252 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/sed.js @@ -0,0 +1,43 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options ,] search_regex, replace_str, file) +//@ Available options: +//@ +//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input +//@ using the given search regex and replacement string. Returns the new string after replacement. +function _sed(options, regex, replacement, file) { + options = common.parseOptions(options, { + 'i': 'inplace' + }); + + if (typeof replacement === 'string') + replacement = replacement; // no-op + else if (typeof replacement === 'number') + replacement = replacement.toString(); // fallback + else + common.error('invalid replacement string'); + + if (!file) + common.error('no file given'); + + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + + return common.ShellString(result); +} +module.exports = _sed; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/tempdir.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/tempdir.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/tempdir.js new file mode 100644 index 0000000..45953c2 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/tempdir.js @@ -0,0 +1,56 @@ +var common = require('./common'); +var os = require('os'); +var fs = require('fs'); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) + return false; + + if (!fs.statSync(dir).isDirectory()) + return false; + + var testFile = dir+'/'+common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + return false; + } +} + + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + var state = common.state; + if (state.tempDir) + return state.tempDir; // from cache + + state.tempDir = writeableDir(os.tempDir && os.tempDir()) || // node 0.8+ + writeableDir(process.env['TMPDIR']) || + writeableDir(process.env['TEMP']) || + writeableDir(process.env['TMP']) || + writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return state.tempDir; +} +module.exports = _tempDir; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/test.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/test.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/test.js new file mode 100644 index 0000000..8a4ac7d --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/test.js @@ -0,0 +1,85 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### test(expression) +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symboilc link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates expression using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) + common.error('no path given'); + + // hack - only works with unary primaries + options = common.parseOptions(options, { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket' + }); + + var canInterpret = false; + for (var key in options) + if (options[key] === true) { + canInterpret = true; + break; + } + + if (!canInterpret) + common.error('could not interpret expression'); + + if (options.link) { + try { + return fs.lstatSync(path).isSymbolicLink(); + } catch(e) { + return false; + } + } + + if (!fs.existsSync(path)) + return false; + + if (options.exists) + return true; + + var stats = fs.statSync(path); + + if (options.block) + return stats.isBlockDevice(); + + if (options.character) + return stats.isCharacterDevice(); + + if (options.directory) + return stats.isDirectory(); + + if (options.file) + return stats.isFile(); + + if (options.pipe) + return stats.isFIFO(); + + if (options.socket) + return stats.isSocket(); +} // test +module.exports = _test; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/to.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/to.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/to.js new file mode 100644 index 0000000..f029999 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/to.js @@ -0,0 +1,29 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.writeFileSync(file, this.toString(), 'utf8'); + } catch(e) { + common.error('could not write to file (code '+e.code+'): '+file, true); + } +} +module.exports = _to; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/toEnd.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/toEnd.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/toEnd.js new file mode 100644 index 0000000..f6d099d --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/toEnd.js @@ -0,0 +1,29 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). +function _toEnd(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.appendFileSync(file, this.toString(), 'utf8'); + } catch(e) { + common.error('could not append to file (code '+e.code+'): '+file, true); + } +} +module.exports = _toEnd; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/which.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/which.js b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/which.js new file mode 100644 index 0000000..fadb96c --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/node_modules/shelljs/src/which.js @@ -0,0 +1,79 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + for (i=1;i<2;i++) {} + + if (!p) + return []; + + if (common.platform === 'win') + return p.split(';'); + else + return p.split(':'); +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +//@ Returns string containing the absolute path to the command. +function _which(options, cmd) { + if (!cmd) + common.error('must specify command'); + + var pathEnv = process.env.path || process.env.Path || process.env.PATH, + pathArray = splitPath(pathEnv), + where = null; + + // No relative/absolute paths provided? + if (cmd.search(/\//) === -1) { + // Search for command in PATH + pathArray.forEach(function(dir) { + if (where) + return; // already found it + + var attempt = path.resolve(dir + '/' + cmd); + if (fs.existsSync(attempt)) { + where = attempt; + return; + } + + if (common.platform === 'win') { + var baseAttempt = attempt; + attempt = baseAttempt + '.exe'; + if (fs.existsSync(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.cmd'; + if (fs.existsSync(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.bat'; + if (fs.existsSync(attempt)) { + where = attempt; + return; + } + } // if 'win' + }); + } + + // Command not found anywhere? + if (!fs.existsSync(cmd) && !where) + return null; + + where = where || path.resolve(cmd); + + return common.ShellString(where); +} +module.exports = _which; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/package.json ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/package.json b/node_modules/ios-sim/node_modules/simctl/package.json new file mode 100644 index 0000000..f1d5fa6 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/package.json @@ -0,0 +1,45 @@ +{ + "name": "simctl", + "version": "1.0.0", + "description": "library for Xcode 8+ simctl utility on macOS", + "repository": { + "type": "git", + "url": "git+https://github.com/phonegap/simctl.git" + }, + "main": "simctl.js", + "dependencies": { + "shelljs": "^0.2.6", + "tail": "^0.4.0" + }, + "devDependencies": { + "jasmine-node": "^1.14.5", + "jscs": "^2.11.0", + "jshint": "^2.9.1" + }, + "scripts": { + "test": "npm run jasmine", + "posttest": "npm run jshint", + "jshint": "jshint lib ./simctl.js", + "postjshint": "npm run jscs", + "jscs": "jscs lib ./simctl.js", + "jasmine": "jasmine-node --captureExceptions --color spec" + }, + "keywords": [ + "simctl", + "iOS Simulator" + ], + "author": { + "name": "Shazron Abdullah" + }, + "license": "MIT", + "readme": "[![Build status](https://ci.appveyor.com/api/projects/status/4p87ytoudwh7g132/branch/master?svg=true)](https://ci.appveyor.com/project/shazron/simctl/branch/master)\n[![Build Status](https://travis-ci.org/phonegap/ios-sim.svg?branch=master)](https://travis-ci.org/phonegap/simctl)\n\n## library wrapper for Xcode's simctl utility on OS X\n\nUsed by [ios-sim](https://www.npmjs.com/package/ios-sim)\n\n## Requirements\n\nXcode 8 or greater\n", + "readmeFilename": "README.md", + "gitHead": "125abc5f0b0581ab59c682fde46225622d53be55", + "bugs": { + "url": "https://github.com/phonegap/simctl/issues" + }, + "homepage": "https://github.com/phonegap/simctl#readme", + "_id": "simctl@1.0.0", + "_shasum": "49e26d850d8dc8850bf63fbf83eb817732721140", + "_from": "simctl@>=1.0.0 <2.0.0" +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/simctl.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/simctl.js b/node_modules/ios-sim/node_modules/simctl/simctl.js new file mode 100644 index 0000000..1fb78ce --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/simctl.js @@ -0,0 +1,196 @@ +/* +The MIT License (MIT) + +Copyright (c) 2014 Shazron Abdullah. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +var shell = require('shelljs'), + path = require('path'), + util = require('util'), + Tail = require('tail').Tail, + SimCtlExtensions = require('./lib/simctl-extensions'); + +exports = module.exports = { + + set noxpc(b) { + this._noxpc = b; + }, + + get noxpc() { + return this._noxpc; + }, + + extensions: SimCtlExtensions, + + check_prerequisites: function() { + var command = util.format('xcrun simctl help'); + var obj = shell.exec(command, {silent: true}); + + if (obj.code !== 0) { + obj.output = 'simctl was not found.\n'; + obj.output += 'Check that you have Xcode 7.x installed:\n'; + obj.output += '\txcodebuild --version'; + obj.output += 'Check that you have Xcode 7.x selected:\n'; + obj.output += '\txcode-select --print-path'; + } + + return obj; + }, + + create: function(name, device_type_id, runtime_id) { + var command = util.format('xcrun simctl create "%s" "%s" "%s"', name, device_type_id, runtime_id); + return shell.exec(command); + }, + + del: function(device) { + var command = util.format('xcrun simctl delete "%s"', device); + return shell.exec(command); + }, + + erase: function(device) { + var command = util.format('xcrun simctl erase "%s"', device); + return shell.exec(command); + }, + + boot: function(device) { + var command = util.format('xcrun simctl boot "%s"', device); + return shell.exec(command); + }, + + shutdown: function(device) { + var command = util.format('xcrun simctl shutdown "%s"', device); + return shell.exec(command); + }, + + rename: function(device, name) { + var command = util.format('xcrun simctl rename "%s" "%s"', device, name); + return shell.exec(command); + }, + + getenv: function(device, variable_name) { + var command = util.format('xcrun simctl getenv "%s" "%s"', device, variable_name); + return shell.exec(command); + }, + + openurl: function(device, url) { + var command = util.format('xcrun simctl openurl "%s" "%s"', device, url); + return shell.exec(command); + }, + + addphoto: function(device, path) { + var command = util.format('xcrun simctl addphoto "%s" "%s"', device, path); + return shell.exec(command); + }, + + install: function(device, path) { + var command = util.format('xcrun simctl install "%s" "%s"', device, path); + return shell.exec(command); + }, + + uninstall: function(device, app_identifier) { + var command = util.format('xcrun simctl uninstall "%s" "%s"', device, app_identifier); + return shell.exec(command); + }, + + launch: function(wait_for_debugger, device, app_identifier, argv) { + var wait_flag = ''; + if (wait_for_debugger) { + wait_flag = '--wait-for-debugger'; + } + + var argv_expanded = ''; + if (argv.length > 0) { + argv_expanded = argv.map(function(arg) { + return '\'' + arg + '\''; + }).join(' '); + } + + var command = util.format('xcrun simctl launch %s "%s" "%s" %s', + wait_flag, device, app_identifier, argv_expanded); + return shell.exec(command); + }, + + spawn: function(wait_for_debugger, arch, device, path_to_executable, argv) { + var wait_flag = ''; + if (wait_for_debugger) { + wait_flag = '--wait-for-debugger'; + } + + var arch_flag = ''; + if (arch) { + arch_flag = util.format('--arch="%s"', arch); + } + + var argv_expanded = ''; + if (argv.length > 0) { + argv_expanded = argv.map(function(arg) { + return '\'' + arg + '\''; + }).join(' '); + } + + var command = util.format('xcrun simctl spawn %s %s "%s" "%s" %s', + wait_flag, arch_flag, device, path_to_executable, argv_expanded); + return shell.exec(command); + }, + + list: function(options) { + var sublist = ''; + options = options || {}; + + if (options.devices) { + sublist = 'devices'; + } else if (options.devicetypes) { + sublist = 'devicetypes'; + } else if (options.runtimes) { + sublist = 'runtimes'; + } else if (options.pairs) { + sublist = 'pairs'; + } + + var command = util.format('xcrun simctl list %s --json', sublist); + var obj = shell.exec(command, { silent: options.silent }); + + if (obj.code === 0) { + try { + obj.json = JSON.parse(obj.output); + } catch (err) { + console.error(err.stack); + } + } + + return obj; + }, + + notify_post: function(device, notification_name) { + var command = util.format('xcrun simctl notify_post "%s" "%s"', device, notification_name); + return shell.exec(command); + }, + + icloud_sync: function(device) { + var command = util.format('xcrun simctl icloud_sync "%s"', device); + return shell.exec(command); + }, + + help: function(subcommand) { + var command = util.format('xcrun simctl help "%s"', subcommand); + return shell.exec(command); + } +}; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/node_modules/simctl/spec/fixture/list.json ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/node_modules/simctl/spec/fixture/list.json b/node_modules/ios-sim/node_modules/simctl/spec/fixture/list.json new file mode 100644 index 0000000..60985f6 --- /dev/null +++ b/node_modules/ios-sim/node_modules/simctl/spec/fixture/list.json @@ -0,0 +1,617 @@ +{ + "devicetypes" : [ + { + "name" : "iPhone 4s", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-4s" + }, + { + "name" : "iPhone 5", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5" + }, + { + "name" : "iPhone 5s", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-5s" + }, + { + "name" : "iPhone 6", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6" + }, + { + "name" : "iPhone 6 Plus", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus" + }, + { + "name" : "iPhone 6s", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s" + }, + { + "name" : "iPhone 6s Plus", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus" + }, + { + "name" : "iPhone 7", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7" + }, + { + "name" : "iPhone 7 Plus", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus" + }, + { + "name" : "iPhone SE", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-SE" + }, + { + "name" : "iPad 2", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-2" + }, + { + "name" : "iPad Retina", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Retina" + }, + { + "name" : "iPad Air", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air" + }, + { + "name" : "iPad Air 2", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Air-2" + }, + { + "name" : "iPad (5th generation)", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-" + }, + { + "name" : "iPad Pro (9.7-inch)", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-" + }, + { + "name" : "iPad Pro (12.9-inch)", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro" + }, + { + "name" : "iPad Pro (12.9-inch) (2nd generation)", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" + }, + { + "name" : "iPad Pro (10.5-inch)", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-" + }, + { + "name" : "Apple TV 1080p", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p" + }, + { + "name" : "Apple Watch - 38mm", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm" + }, + { + "name" : "Apple Watch - 42mm", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm" + }, + { + "name" : "Apple Watch Series 2 - 38mm", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm" + }, + { + "name" : "Apple Watch Series 2 - 42mm", + "identifier" : "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm" + } + ], + "runtimes" : [ + { + "buildversion" : "15A5278f", + "availability" : "(available)", + "name" : "iOS 11.0", + "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-11-0", + "version" : "11.0" + }, + { + "buildversion" : "15J5284e", + "availability" : "(available)", + "name" : "tvOS 11.0", + "identifier" : "com.apple.CoreSimulator.SimRuntime.tvOS-11-0", + "version" : "11.0" + }, + { + "buildversion" : "15R5281f", + "availability" : "(available)", + "name" : "watchOS 4.0", + "identifier" : "com.apple.CoreSimulator.SimRuntime.watchOS-4-0", + "version" : "4.0" + } + ], + "devices" : { + "iOS 11.0" : [ + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 5s", + "udid" : "90EDD7FB-282F-4902-83C0-954F683FB58C" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 6", + "udid" : "CEFCEEB3-F16E-418F-A8D9-8BDDE22E376B" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 6 Plus", + "udid" : "62F9F7BA-9529-468A-A9C1-31304514A305" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 6s", + "udid" : "E47312EF-4A77-46D9-ADC1-C60563BBD462" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 6s Plus", + "udid" : "3BCF226B-216F-41FB-8BD1-42E1B3D35E96" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 7", + "udid" : "6278DDAB-E66E-4DC1-BBC2-55340A86077B" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone 7 Plus", + "udid" : "2514D029-A2DF-423A-803D-63F602AF3F6B" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPhone SE", + "udid" : "E1AF56B8-FF00-4349-BA96-38B7132A7F02" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Air", + "udid" : "1D906B96-4834-47FC-A7F9-AC8AEAC312A6" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Air 2", + "udid" : "008AE630-3481-4AAB-8D4F-A13A64417C7A" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad (5th generation)", + "udid" : "E0691C07-BD74-43D1-AC51-050B43912BCD" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Pro (9.7 inch)", + "udid" : "F70A11BD-C120-452E-8C39-D80FB3581A5D" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Pro (12.9 inch)", + "udid" : "649AA16D-CACF-41D0-9B7E-0C28865F4104" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Pro (12.9-inch) (2nd generation)", + "udid" : "CECC5304-4CF2-4D3E-9AA8-EF4F4B09795E" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "iPad Pro (10.5-inch)", + "udid" : "8B7A6405-B969-4FFB-800F-1DA09F88DFF1" + } + ], + "com.apple.CoreSimulator.SimRuntime.watchOS-3-1" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch - 38mm", + "udid" : "CB4EEEA0-522A-46A3-B651-7BB1DDB78BAA" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch - 42mm", + "udid" : "E1BF737C-76B5-410D-B1D6-86653A5D185B" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "A089A64E-A83A-4E03-97AC-4065C2767F4F" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "9A7C0B24-071F-4FEF-8D78-F109D51E5EA0" + } + ], + "com.apple.CoreSimulator.SimRuntime.iOS-10-2" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 5", + "udid" : "93CE90F5-8834-4153-81E0-FC26F6F704AA" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 5s", + "udid" : "D1B033B9-ABC6-4842-886C-7DB8FAC6089C" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6", + "udid" : "8A28FD8A-3A1E-41E0-B714-42D4A0D85F40" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6 Plus", + "udid" : "D420BF01-19F6-4241-B434-D0ADE9AF5C0B" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6s", + "udid" : "0AF827DF-F8A5-4745-BDB7-91B0868FAFD9" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6s Plus", + "udid" : "B9FC4934-0534-49D8-B05A-7E0B827CFE2E" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 7", + "udid" : "E7FF4BC9-016D-444C-A11C-00F17447B5C0" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 7 Plus", + "udid" : "930EE33E-3688-4FD2-997A-41D5B2E8D2AD" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone SE", + "udid" : "ACF622CF-3958-4B21-A7F5-04C4DF7171A4" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Retina", + "udid" : "B4D33871-C253-4DD9-A7EB-4B0C49FD0AF9" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Air", + "udid" : "C0CAC3C1-E319-43B7-9269-25CAF0EC74A1" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Air 2", + "udid" : "3C7A3B8E-9368-44D4-808E-00E6113E50CE" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Pro (9.7 inch)", + "udid" : "B597EE0E-26E2-404B-9F3A-9551170D547E" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Pro (12.9 inch)", + "udid" : "220DD398-99B3-4840-A4F3-80480801FC79" + } + ], + "tvOS 11.0" : [ + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "Apple TV 1080p", + "udid" : "81186783-7F0F-460F-96AF-4BDA342D5E6A" + } + ], + "com.apple.CoreSimulator.SimRuntime.tvOS-10-1" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple TV 1080p", + "udid" : "94187B12-9791-4163-86E4-C632392AE715" + } + ], + "com.apple.CoreSimulator.SimRuntime.tvOS-10-2" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple TV 1080p", + "udid" : "D2BE66BC-F5F7-49E8-A152-EACC8FE3EBA4" + } + ], + "com.apple.CoreSimulator.SimRuntime.watchOS-3-2" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch - 38mm", + "udid" : "934C236B-1651-4FE5-A0CB-D8408ED73F26" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch - 42mm", + "udid" : "4C69478B-F0BA-47EE-BE03-7EBDC046A821" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "D505C680-CDAE-41F8-8570-EDB731D5BC7E" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "BF47F600-1651-44F1-BF85-F30015257135" + } + ], + "com.apple.CoreSimulator.SimRuntime.iOS-10-3" : [ + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 5", + "udid" : "310D3B96-24D4-4610-ADA8-25667AB53B18" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 5s", + "udid" : "8A172233-647B-4259-85E8-D0A796D5BF5E" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6", + "udid" : "CE0124DB-7DF9-4311-B686-6DAACC5CF4E5" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6 Plus", + "udid" : "B2C52237-9652-4AA5-8CF3-CAC2AFA5E8AA" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6s", + "udid" : "D649BEC5-2F44-43ED-90D3-0CEA1505B3AA" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 6s Plus", + "udid" : "B817B81F-D7AF-486F-85A6-F7151788F163" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 7", + "udid" : "739FFF90-F2EF-488A-A88A-B3AADA8831DE" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone 7 Plus", + "udid" : "4F79A21C-D3A4-432F-A655-BE7966B5C605" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPhone SE", + "udid" : "C310CF39-B994-4323-8063-DF7F995F822C" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Air", + "udid" : "5EFAC0B6-0583-48EA-BDC6-E80FBFF76116" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Air 2", + "udid" : "C5227DFA-FE4F-4517-95D1-066C8AE65307" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Pro (9.7 inch)", + "udid" : "45AB7B33-CC85-4C25-B6E9-EB861126ABAF" + }, + { + "state" : "Shutdown", + "availability" : " (unavailable, runtime profile not found)", + "name" : "iPad Pro (12.9 inch)", + "udid" : "DB13CD84-BAB6-48AA-B402-D0A6B8CEF347" + } + ], + "watchOS 4.0" : [ + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "Apple Watch - 38mm", + "udid" : "3F9314D4-1BEB-49F9-B752-F4945498019B" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "Apple Watch - 42mm", + "udid" : "0FD51B8F-B2A9-4893-A3AB-8F99140D18BC" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "6621CC54-C40D-4B3A-B3D6-3B1451CE5C6C" + }, + { + "state" : "Shutdown", + "availability" : "(available)", + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "FAAC4B0F-A273-4E71-A193-D6098AE3D0B1" + } + ] + }, + "pairs" : { + "54AEA67D-DA3C-4CCE-88F2-EB53AF9D9652" : { + "watch" : { + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "BF47F600-1651-44F1-BF85-F30015257135", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7 Plus", + "udid" : "4F79A21C-D3A4-432F-A655-BE7966B5C605", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + }, + "2AEB0DD4-F854-4861-8BEA-43D6CDF72B3C" : { + "watch" : { + "name" : "Apple Watch - 42mm", + "udid" : "0FD51B8F-B2A9-4893-A3AB-8F99140D18BC", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 6s Plus", + "udid" : "3BCF226B-216F-41FB-8BD1-42E1B3D35E96", + "state" : "Shutdown" + }, + "state" : "(active, disconnected)" + }, + "ACC60596-CAF9-414E-8D6A-0EECAB8F1392" : { + "watch" : { + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "6621CC54-C40D-4B3A-B3D6-3B1451CE5C6C", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7", + "udid" : "6278DDAB-E66E-4DC1-BBC2-55340A86077B", + "state" : "Shutdown" + }, + "state" : "(active, disconnected)" + }, + "C482FCBE-3EA5-4726-A18E-C2289AC97181" : { + "watch" : { + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "A089A64E-A83A-4E03-97AC-4065C2767F4F", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7", + "udid" : "E7FF4BC9-016D-444C-A11C-00F17447B5C0", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + }, + "11518B00-90AA-40D9-A361-486AE3BBBD23" : { + "watch" : { + "name" : "Apple Watch - 38mm", + "udid" : "934C236B-1651-4FE5-A0CB-D8408ED73F26", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 6s", + "udid" : "D649BEC5-2F44-43ED-90D3-0CEA1505B3AA", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + }, + "4E765022-977B-46B5-878F-3F8BD1C109B8" : { + "watch" : { + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "FAAC4B0F-A273-4E71-A193-D6098AE3D0B1", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7 Plus", + "udid" : "2514D029-A2DF-423A-803D-63F602AF3F6B", + "state" : "Shutdown" + }, + "state" : "(active, disconnected)" + }, + "D383D4FB-98AD-489D-8972-548077111E46" : { + "watch" : { + "name" : "Apple Watch - 42mm", + "udid" : "4C69478B-F0BA-47EE-BE03-7EBDC046A821", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 6s Plus", + "udid" : "B817B81F-D7AF-486F-85A6-F7151788F163", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + }, + "E7B45654-1DA4-4E7E-96F3-942B0F49ECE3" : { + "watch" : { + "name" : "Apple Watch Series 2 - 38mm", + "udid" : "D505C680-CDAE-41F8-8570-EDB731D5BC7E", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7", + "udid" : "739FFF90-F2EF-488A-A88A-B3AADA8831DE", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + }, + "5C436B84-09D4-4CDF-B0EF-7847247F0342" : { + "watch" : { + "name" : "Apple Watch - 38mm", + "udid" : "3F9314D4-1BEB-49F9-B752-F4945498019B", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 6s", + "udid" : "E47312EF-4A77-46D9-ADC1-C60563BBD462", + "state" : "Shutdown" + }, + "state" : "(active, disconnected)" + }, + "3CF04E41-DCB0-4DFA-B230-94767AF83754" : { + "watch" : { + "name" : "Apple Watch Series 2 - 42mm", + "udid" : "9A7C0B24-071F-4FEF-8D78-F109D51E5EA0", + "state" : "Shutdown" + }, + "phone" : { + "name" : "iPhone 7 Plus", + "udid" : "930EE33E-3688-4FD2-997A-41D5B2E8D2AD", + "state" : "Shutdown" + }, + "state" : "(unavailable)" + } + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/package.json ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/package.json b/node_modules/ios-sim/package.json index cb86144..a05c90b 100644 --- a/node_modules/ios-sim/package.json +++ b/node_modules/ios-sim/package.json @@ -1,6 +1,6 @@ { "name": "ios-sim", - "version": "5.0.13", + "version": "5.1.0", "preferGlobal": "true", "description": "launch iOS apps into the iOS Simulator from the command line (Xcode 7.0+)", "main": "ios-sim.js", @@ -27,7 +27,7 @@ "license": "MIT", "dependencies": { "plist": "^1.2.0", - "simctl": "^0.1.0", + "simctl": "^1.0.0", "nopt": "1.0.9", "bplist-parser": "^0.0.6" }, @@ -44,44 +44,11 @@ "jscs": "jscs src ./ios-sim.js", "jasmine": "jasmine-node --captureExceptions --color spec" }, - "gitHead": "31d6083642674422860227ef694ec1d2533729c9", + "readme": "[![Build status](https://ci.appveyor.com/api/projects/status/0kw833771uu622fs?svg=true)](https://ci.appveyor.com/project/shazron/ios-sim)\n[![Build Status](https://travis-ci.org/phonegap/ios-sim.svg?branch=master)](https://travis-ci.org/phonegap/ios-sim)\n\nios-sim\n=======\n\nSupports Xcode 6 only since version 3.x.\n\nThe ios-sim tool is a command-line utility that launches an iOS application on the iOS Simulator. This allows for niceties such as automated testing without having to open Xcode.\n\nFeatures\n--------\n\n* Choose the device family to simulate, i.e. iPhone or iPad. Run using \"showdevicetypes\" option to see available device types, and pass it in as the \"devicetypeid\" parameter.\n\nSee the `--help` option for more info.\n\nThe unimplemented options below are in the [backlog](https://github.com/phonegap/ios-sim/milestones/ios-sim%204.2.0)\n\nUsage\n-----\n\n```\n\n Usage: ios-sim <command> <options> [--args ...]\n \n Commands:\n showsdk s List the available iOS SDK versions\n showdevicetypes List the available device types\n launch <application path> Launch the application at the specified path on the iOS Simulator\n start Launch iOS Simulator without an app\n install <application path> Install the application at the specified path on the iOS Simulator without launching the app\n\n Options:\n --version Print the version of ios-sim\n --help Show this help text\n --exit Exit after startup\n --log <log file path> The path where log of the app running in the Simulator will be redirected to\n --devicetypeid <device type> The id of the device type that should be simulated (Xcode6+). Use 'showdevicetypes' to list devices.\n e.g \"com.apple.CoreSimulator.SimDeviceType.Resizable-iPh one6, 8.0\"\n \n Removed in version 4.x:\n --stdout <stdout file path> The path where stdout of the simulator will be redirected to (defaults to stdout of ios-sim)\n --stderr <stderr file path> The path where stderr of the simulator will be redirected to (defaults to stderr of ios-sim)\n --sdk <sdkversion> The iOS SDK version to run the application on (defaults to the latest)\n --family <device family> The device type that should be simulated (defaults to `iphone')\n --retina Start a retina device\n --tall In combination with --retina flag, start the tall version of the retina device (e.g. iPhone 5 (4-inch))\n --64bit In combination with --retina flag and the --tall flag, start the 64bit version of the tall retina device (e.g. iPhone 5S (4-inch 64bit))\n \n Unimplemented in thi s version:\n --verbose Set the output level to verbose\n --timeout <seconds> The timeout time to wait for a response from the Simulator. Default value: 30 seconds\n --args <...> All following arguments will be passed on to the application\n --env <environment file path> A plist file containing environment key-value pairs that should be set\n --setenv NAME=VALUE Set an environment variable\n \n```\n\nInstallation\n------------\n\nChoose one of the following installation methods.\n\n### Node JS\n\nInstall using node.js (at least 0.10.20):\n\n $ npm install ios-sim -g\n\n### Zip\n\nDownload a zip file:\n\n $ curl -L https://github.com/phonegap/ios-sim/archive/master.zip -o ios-sim.zip\n $ unzip ios-sim.zip\n\n### Git\n\nDownload using git clone:\n\n $ git clone git://github.com/phonegap/ios-sim.git\n\nTroubleshooting\n---------------\n\nMake sure you enable Developer Mode on your machine:\n\n $ DevToolsSecurity -enable\n\nMake sure multiple instances of launchd_sim are not running:\n\n $ killall launchd_sim\n\nLicense\n-------\n\nThis project is available under the MIT license. See [LICENSE][license].\n\n[license]: https://github.com/phonegap/ios-sim/blob/master/LICENSE\n", + "readmeFilename": "README.md", + "gitHead": "38adbeb0a9cb0d6af537618bd21cf5d5a42f2d58", "homepage": "https://github.com/phonegap/ios-sim#readme", - "_id": "ios-sim@5.0.13", - "_shasum": "e5749cf567718f4024f6d622e88a2bf7ea9472f1", - "_from": "ios-sim@>=5.0.13 <6.0.0", - "_npmVersion": "3.10.9", - "_nodeVersion": "6.7.0", - "_npmUser": { - "name": "shazron", - "email": "shaz...@gmail.com" - }, - "dist": { - "shasum": "e5749cf567718f4024f6d622e88a2bf7ea9472f1", - "tarball": "https://registry.npmjs.org/ios-sim/-/ios-sim-5.0.13.tgz" - }, - "maintainers": [ - { - "name": "macdonst", - "email": "simon.macdon...@gmail.com" - }, - { - "name": "purplecabbage", - "email": "purplecabb...@gmail.com" - }, - { - "name": "shazron", - "email": "shaz...@gmail.com" - }, - { - "name": "stevegill", - "email": "stevengil...@gmail.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/ios-sim-5.0.13.tgz_1481315599480_0.3072573933750391" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ios-sim/-/ios-sim-5.0.13.tgz", - "readme": "ERROR: No README data found!" + "_id": "ios-sim@5.1.0", + "_shasum": "5d78a29e520ba0973145fb4257eb9b2a41018da6", + "_from": "ios-sim@>=5.1.0 <6.0.0" } http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/spec/fixture/list.json ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/spec/fixture/list.json b/node_modules/ios-sim/spec/fixture/list.json new file mode 100644 index 0000000..148fdbe --- /dev/null +++ b/node_modules/ios-sim/spec/fixture/list.json @@ -0,0 +1,522 @@ +{ + "devicetypes": [{ + "name": "iPhone 4s", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-4s" + }, { + "name": "iPhone 5", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-5" + }, { + "name": "iPhone 5s", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-5s" + }, { + "name": "iPhone 6", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-6" + }, { + "name": "iPhone 6 Plus", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus" + }, { + "name": "iPhone 6s", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-6s" + }, { + "name": "iPhone 6s Plus", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus" + }, { + "name": "iPhone 7", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-7" + }, { + "name": "iPhone 7 Plus", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus" + }, { + "name": "iPhone SE", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-SE" + }, { + "name": "iPad 2", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-2" + }, { + "name": "iPad Retina", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Retina" + }, { + "name": "iPad Air", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Air" + }, { + "name": "iPad Air 2", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Air-2" + }, { + "name": "iPad (5th generation)", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-" + }, { + "name": "iPad Pro (9.7-inch)", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-" + }, { + "name": "iPad Pro (12.9-inch)", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Pro" + }, { + "name": "iPad Pro (12.9-inch) (2nd generation)", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-" + }, { + "name": "iPad Pro (10.5-inch)", + "identifier": "com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-" + }, { + "name": "Apple TV 1080p", + "identifier": "com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p" + }, { + "name": "Apple Watch - 38mm", + "identifier": "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm" + }, { + "name": "Apple Watch - 42mm", + "identifier": "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm" + }, { + "name": "Apple Watch Series 2 - 38mm", + "identifier": "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm" + }, { + "name": "Apple Watch Series 2 - 42mm", + "identifier": "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm" + }], + "runtimes": [{ + "buildversion": "15A5278f", + "availability": "(available)", + "name": "iOS 11.0", + "identifier": "com.apple.CoreSimulator.SimRuntime.iOS-11-0", + "version": "11.0" + }, { + "buildversion": "15J5284e", + "availability": "(available)", + "name": "tvOS 11.0", + "identifier": "com.apple.CoreSimulator.SimRuntime.tvOS-11-0", + "version": "11.0" + }, { + "buildversion": "15R5281f", + "availability": "(available)", + "name": "watchOS 4.0", + "identifier": "com.apple.CoreSimulator.SimRuntime.watchOS-4-0", + "version": "4.0" + }], + "devices": { + "iOS 11.0": [{ + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 5s", + "udid": "90EDD7FB-282F-4902-83C0-954F683FB58C" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 6", + "udid": "CEFCEEB3-F16E-418F-A8D9-8BDDE22E376B" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 6 Plus", + "udid": "62F9F7BA-9529-468A-A9C1-31304514A305" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 6s", + "udid": "E47312EF-4A77-46D9-ADC1-C60563BBD462" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 6s Plus", + "udid": "3BCF226B-216F-41FB-8BD1-42E1B3D35E96" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 7", + "udid": "6278DDAB-E66E-4DC1-BBC2-55340A86077B" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone 7 Plus", + "udid": "2514D029-A2DF-423A-803D-63F602AF3F6B" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPhone SE", + "udid": "E1AF56B8-FF00-4349-BA96-38B7132A7F02" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Air", + "udid": "1D906B96-4834-47FC-A7F9-AC8AEAC312A6" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Air 2", + "udid": "008AE630-3481-4AAB-8D4F-A13A64417C7A" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad (5th generation)", + "udid": "E0691C07-BD74-43D1-AC51-050B43912BCD" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Pro (9.7 inch)", + "udid": "F70A11BD-C120-452E-8C39-D80FB3581A5D" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Pro (12.9 inch)", + "udid": "649AA16D-CACF-41D0-9B7E-0C28865F4104" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Pro (12.9-inch) (2nd generation)", + "udid": "CECC5304-4CF2-4D3E-9AA8-EF4F4B09795E" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "iPad Pro (10.5-inch)", + "udid": "8B7A6405-B969-4FFB-800F-1DA09F88DFF1" + }], + "com.apple.CoreSimulator.SimRuntime.watchOS-3-1": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch - 38mm", + "udid": "CB4EEEA0-522A-46A3-B651-7BB1DDB78BAA" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch - 42mm", + "udid": "E1BF737C-76B5-410D-B1D6-86653A5D185B" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch Series 2 - 38mm", + "udid": "A089A64E-A83A-4E03-97AC-4065C2767F4F" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch Series 2 - 42mm", + "udid": "9A7C0B24-071F-4FEF-8D78-F109D51E5EA0" + }], + "com.apple.CoreSimulator.SimRuntime.iOS-10-2": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 5", + "udid": "93CE90F5-8834-4153-81E0-FC26F6F704AA" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 5s", + "udid": "D1B033B9-ABC6-4842-886C-7DB8FAC6089C" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6", + "udid": "8A28FD8A-3A1E-41E0-B714-42D4A0D85F40" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6 Plus", + "udid": "D420BF01-19F6-4241-B434-D0ADE9AF5C0B" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6s", + "udid": "0AF827DF-F8A5-4745-BDB7-91B0868FAFD9" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6s Plus", + "udid": "B9FC4934-0534-49D8-B05A-7E0B827CFE2E" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 7", + "udid": "E7FF4BC9-016D-444C-A11C-00F17447B5C0" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 7 Plus", + "udid": "930EE33E-3688-4FD2-997A-41D5B2E8D2AD" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone SE", + "udid": "ACF622CF-3958-4B21-A7F5-04C4DF7171A4" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Retina", + "udid": "B4D33871-C253-4DD9-A7EB-4B0C49FD0AF9" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Air", + "udid": "C0CAC3C1-E319-43B7-9269-25CAF0EC74A1" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Air 2", + "udid": "3C7A3B8E-9368-44D4-808E-00E6113E50CE" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Pro (9.7 inch)", + "udid": "B597EE0E-26E2-404B-9F3A-9551170D547E" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Pro (12.9 inch)", + "udid": "220DD398-99B3-4840-A4F3-80480801FC79" + }], + "tvOS 11.0": [{ + "state": "Shutdown", + "availability": "(available)", + "name": "Apple TV 1080p", + "udid": "81186783-7F0F-460F-96AF-4BDA342D5E6A" + }], + "com.apple.CoreSimulator.SimRuntime.tvOS-10-1": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple TV 1080p", + "udid": "94187B12-9791-4163-86E4-C632392AE715" + }], + "com.apple.CoreSimulator.SimRuntime.tvOS-10-2": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple TV 1080p", + "udid": "D2BE66BC-F5F7-49E8-A152-EACC8FE3EBA4" + }], + "com.apple.CoreSimulator.SimRuntime.watchOS-3-2": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch - 38mm", + "udid": "934C236B-1651-4FE5-A0CB-D8408ED73F26" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch - 42mm", + "udid": "4C69478B-F0BA-47EE-BE03-7EBDC046A821" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch Series 2 - 38mm", + "udid": "D505C680-CDAE-41F8-8570-EDB731D5BC7E" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "Apple Watch Series 2 - 42mm", + "udid": "BF47F600-1651-44F1-BF85-F30015257135" + }], + "com.apple.CoreSimulator.SimRuntime.iOS-10-3": [{ + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 5", + "udid": "310D3B96-24D4-4610-ADA8-25667AB53B18" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 5s", + "udid": "8A172233-647B-4259-85E8-D0A796D5BF5E" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6", + "udid": "CE0124DB-7DF9-4311-B686-6DAACC5CF4E5" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6 Plus", + "udid": "B2C52237-9652-4AA5-8CF3-CAC2AFA5E8AA" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6s", + "udid": "D649BEC5-2F44-43ED-90D3-0CEA1505B3AA" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 6s Plus", + "udid": "B817B81F-D7AF-486F-85A6-F7151788F163" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 7", + "udid": "739FFF90-F2EF-488A-A88A-B3AADA8831DE" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone 7 Plus", + "udid": "4F79A21C-D3A4-432F-A655-BE7966B5C605" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPhone SE", + "udid": "C310CF39-B994-4323-8063-DF7F995F822C" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Air", + "udid": "5EFAC0B6-0583-48EA-BDC6-E80FBFF76116" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Air 2", + "udid": "C5227DFA-FE4F-4517-95D1-066C8AE65307" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Pro (9.7 inch)", + "udid": "45AB7B33-CC85-4C25-B6E9-EB861126ABAF" + }, { + "state": "Shutdown", + "availability": " (unavailable, runtime profile not found)", + "name": "iPad Pro (12.9 inch)", + "udid": "DB13CD84-BAB6-48AA-B402-D0A6B8CEF347" + }], + "watchOS 4.0": [{ + "state": "Shutdown", + "availability": "(available)", + "name": "Apple Watch - 38mm", + "udid": "3F9314D4-1BEB-49F9-B752-F4945498019B" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "Apple Watch - 42mm", + "udid": "0FD51B8F-B2A9-4893-A3AB-8F99140D18BC" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "Apple Watch Series 2 - 38mm", + "udid": "6621CC54-C40D-4B3A-B3D6-3B1451CE5C6C" + }, { + "state": "Shutdown", + "availability": "(available)", + "name": "Apple Watch Series 2 - 42mm", + "udid": "FAAC4B0F-A273-4E71-A193-D6098AE3D0B1" + }] + }, + "pairs": { + "54AEA67D-DA3C-4CCE-88F2-EB53AF9D9652": { + "watch": { + "name": "Apple Watch Series 2 - 42mm", + "udid": "BF47F600-1651-44F1-BF85-F30015257135", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7 Plus", + "udid": "4F79A21C-D3A4-432F-A655-BE7966B5C605", + "state": "Shutdown" + }, + "state": "(unavailable)" + }, + "2AEB0DD4-F854-4861-8BEA-43D6CDF72B3C": { + "watch": { + "name": "Apple Watch - 42mm", + "udid": "0FD51B8F-B2A9-4893-A3AB-8F99140D18BC", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 6s Plus", + "udid": "3BCF226B-216F-41FB-8BD1-42E1B3D35E96", + "state": "Shutdown" + }, + "state": "(active, disconnected)" + }, + "ACC60596-CAF9-414E-8D6A-0EECAB8F1392": { + "watch": { + "name": "Apple Watch Series 2 - 38mm", + "udid": "6621CC54-C40D-4B3A-B3D6-3B1451CE5C6C", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7", + "udid": "6278DDAB-E66E-4DC1-BBC2-55340A86077B", + "state": "Shutdown" + }, + "state": "(active, disconnected)" + }, + "C482FCBE-3EA5-4726-A18E-C2289AC97181": { + "watch": { + "name": "Apple Watch Series 2 - 38mm", + "udid": "A089A64E-A83A-4E03-97AC-4065C2767F4F", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7", + "udid": "E7FF4BC9-016D-444C-A11C-00F17447B5C0", + "state": "Shutdown" + }, + "state": "(unavailable)" + }, + "11518B00-90AA-40D9-A361-486AE3BBBD23": { + "watch": { + "name": "Apple Watch - 38mm", + "udid": "934C236B-1651-4FE5-A0CB-D8408ED73F26", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 6s", + "udid": "D649BEC5-2F44-43ED-90D3-0CEA1505B3AA", + "state": "Shutdown" + }, + "state": "(unavailable)" + }, + "4E765022-977B-46B5-878F-3F8BD1C109B8": { + "watch": { + "name": "Apple Watch Series 2 - 42mm", + "udid": "FAAC4B0F-A273-4E71-A193-D6098AE3D0B1", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7 Plus", + "udid": "2514D029-A2DF-423A-803D-63F602AF3F6B", + "state": "Shutdown" + }, + "state": "(active, disconnected)" + }, + "D383D4FB-98AD-489D-8972-548077111E46": { + "watch": { + "name": "Apple Watch - 42mm", + "udid": "4C69478B-F0BA-47EE-BE03-7EBDC046A821", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 6s Plus", + "udid": "B817B81F-D7AF-486F-85A6-F7151788F163", + "state": "Shutdown" + }, + "state": "(unavailable)" + }, + "E7B45654-1DA4-4E7E-96F3-942B0F49ECE3": { + "watch": { + "name": "Apple Watch Series 2 - 38mm", + "udid": "D505C680-CDAE-41F8-8570-EDB731D5BC7E", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7", + "udid": "739FFF90-F2EF-488A-A88A-B3AADA8831DE", + "state": "Shutdown" + }, + "state": "(unavailable)" + }, + "5C436B84-09D4-4CDF-B0EF-7847247F0342": { + "watch": { + "name": "Apple Watch - 38mm", + "udid": "3F9314D4-1BEB-49F9-B752-F4945498019B", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 6s", + "udid": "E47312EF-4A77-46D9-ADC1-C60563BBD462", + "state": "Shutdown" + }, + "state": "(active, disconnected)" + }, + "3CF04E41-DCB0-4DFA-B230-94767AF83754": { + "watch": { + "name": "Apple Watch Series 2 - 42mm", + "udid": "9A7C0B24-071F-4FEF-8D78-F109D51E5EA0", + "state": "Shutdown" + }, + "phone": { + "name": "iPhone 7 Plus", + "udid": "930EE33E-3688-4FD2-997A-41D5B2E8D2AD", + "state": "Shutdown" + }, + "state": "(unavailable)" + } + } +} http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/node_modules/ios-sim/src/lib.js ---------------------------------------------------------------------- diff --git a/node_modules/ios-sim/src/lib.js b/node_modules/ios-sim/src/lib.js index 8358aea..8ea464e 100644 --- a/node_modules/ios-sim/src/lib.js +++ b/node_modules/ios-sim/src/lib.js @@ -51,24 +51,21 @@ function findFirstAvailableDevice(list) { var available_runtimes = {}; list.runtimes.forEach(function(runtime) { - if (runtime.available) { - available_runtimes[ runtime.name ] = true; - } + available_runtimes[ runtime.name ] = (runtime.availability === '(available)'); }); - list.devices.some(function(deviceGroup) { - deviceGroup.devices.some(function(device) { - if (available_runtimes[deviceGroup.runtime]) { + Object.keys(list.devices).some(function(deviceGroup) { + return list.devices[deviceGroup].some(function(device) { + if (available_runtimes[deviceGroup]) { ret_obj = { name: device.name, - id: device.id, - runtime: deviceGroup.runtime + id: device.udid, + runtime: deviceGroup }; return true; } return false; }); - return false; }); return ret_obj; @@ -87,24 +84,22 @@ function findRuntimesGroupByDeviceProperty(list, deviceProperty, availableOnly) var available_runtimes = {}; list.runtimes.forEach(function(runtime) { - if (runtime.available) { - available_runtimes[ runtime.name ] = true; - } + available_runtimes[ runtime.name ] = (runtime.availability === '(available)'); }); - list.devices.forEach(function(deviceGroup) { - deviceGroup.devices.forEach(function(device) { + Object.keys(list.devices).forEach(function(deviceGroup) { + list.devices[deviceGroup].forEach(function(device) { var devicePropertyValue = device[deviceProperty]; if (!runtimes[devicePropertyValue]) { runtimes[devicePropertyValue] = []; } if (availableOnly) { - if (available_runtimes[deviceGroup.runtime]) { - runtimes[devicePropertyValue].push(deviceGroup.runtime); + if (available_runtimes[deviceGroup]) { + runtimes[devicePropertyValue].push(deviceGroup); } } else { - runtimes[devicePropertyValue].push(deviceGroup.runtime); + runtimes[devicePropertyValue].push(deviceGroup); } }); }); @@ -174,7 +169,7 @@ function getDeviceFromDeviceTypeId(devicetypeid) { // now find the devicename from the devicetype var devicename_found = list.devicetypes.some(function(deviceGroup) { - if (deviceGroup.id === devicetype) { + if (deviceGroup.identifier === devicetype) { ret_obj.name = deviceGroup.name; return true; } @@ -199,12 +194,12 @@ function getDeviceFromDeviceTypeId(devicetypeid) { } // now find the deviceid (by runtime and devicename) - var deviceid_found = list.devices.some(function(deviceGroup) { + var deviceid_found = Object.keys(list.devices).some(function(deviceGroup) { // found the runtime, now find the actual device matching devicename - if (deviceGroup.runtime === ret_obj.runtime) { - return deviceGroup.devices.some(function(device) { + if (deviceGroup === ret_obj.runtime) { + return list.devices[deviceGroup].some(function(device) { if (filterDeviceName(device.name) === filterDeviceName(ret_obj.name)) { - ret_obj.id = device.id; + ret_obj.id = device.udid; return true; } return false; @@ -256,8 +251,8 @@ var lib = { console.log('Simulator SDK Roots:'); list.runtimes.forEach(function(runtime) { - if (runtime.available) { - console.log(util.format('"%s" (%s)', runtime.name, runtime.build)); + if (runtime.availability === '(available)') { + console.log(util.format('"%s" (%s)', runtime.name, runtime.buildversion)); console.log(util.format('\t(unknown)')); } }); @@ -273,7 +268,7 @@ var lib = { var name_id_map = {}; list.devicetypes.forEach(function(device) { - name_id_map[ filterDeviceName(device.name) ] = device.id; + name_id_map[ filterDeviceName(device.name) ] = device.identifier; }); list = []; http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e74760a/package.json ---------------------------------------------------------------------- diff --git a/package.json b/package.json index 68995b1..0947bd3 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ }, "dependencies": { "cordova-common": "2.0.2", - "ios-sim": "^5.0.13", + "ios-sim": "^5.1.0", "nopt": "^3.0.6", "plist": "^1.2.0", "q": "^1.4.1", --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org