Skip to content

Commit

Permalink
Merge pull request #63 from appcelerator/ios-device
Browse files Browse the repository at this point in the history
[TIMOB-5823] Added iOS device and simulator info to info command.
  • Loading branch information
ayeung committed Oct 25, 2013
2 parents 8a219b3 + 3cffd55 commit 90f6a76
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
47 changes: 43 additions & 4 deletions lib/commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,20 @@ exports.run = function (logger, config, cli, finished) {
|| (cli.sdk.platforms.iphone && fs.existsSync(file = path.join(cli.sdk.platforms.iphone.path, 'cli', 'lib', 'detect.js')))
)
) {
require(file).detect(config, null, function (result) {
result.title = 'iOS';
result.tisdk = tisdk;
next(null, { ios: result });
var mod = require(file);
// detect ios environment
mod.detect(config, null, function (result) {
// detect devices
mod.detectDevices(function (err, devices) {
// detect emulators
mod.detectSimulators(config, function (err, simulators) {
result.title = 'iOS';
result.tisdk = tisdk;
result.devices = devices;
result.simulators = simulators;
next(null, { ios: result });
});
});
});
return;
}
Expand Down Expand Up @@ -609,6 +619,35 @@ function printIos(logger, config, data) {

logger.log(__('Ad Hoc iOS Provisioning Profiles').bold);
printProfiles(data.provisioningProfiles.adhoc);

logger.log(__('iOS Simulators').bold);
if (data.simulators && data.simulators.length) {
logger.log(data.simulators.map(function (sim) {
var features = '';
return sim.name.grey + '\n' + [
' ' + rpad(__('Type')) + ' = ' + cyan(sim.type),
' ' + rpad(__('iOS SDKs')) + ' = ' + cyan(sim.sdks.join(', ')),
' ' + rpad(__('Architecture')) + ' = ' + cyan(sim['64bit'] ? '64-bit' : '32-bit'),
' ' + rpad(__('Features')) + ' = ' + cyan(sim.retina ? 'retina' + (sim.tall ? ', tall' : '') : (sim.tall ? 'tall' : 'n/a'))
].join('\n');
}).join('\n') + '\n');
} else {
logger.log(' ' + __('None').grey + '\n');
}

logger.log(__('Connected iOS Devices').bold);
if (data.devices && data.devices.length) {
logger.log(data.devices.map(function (device) {
return device.name.grey + '\n' + [
' ' + rpad(__('ID')) + ' = ' + cyan(device.udid),
' ' + rpad(__('Type')) + ' = ' + cyan(device.deviceClass + ' (' + device.deviceColor + ')'),
' ' + rpad(__('iOS Version')) + ' = ' + cyan(device.productVersion),
' ' + rpad(__('CPU Architecture')) + ' = ' + cyan(device.cpuArchitecture)
].join('\n');
}).join('\n') + '\n');
} else {
logger.log(' ' + __('None').grey + '\n');
}
}

function printAndroidLegacy(logger, config, data) {
Expand Down
7 changes: 6 additions & 1 deletion locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
"iOS Distribution Certificates": "iOS Distribution Certificates",
"Date Created": "Date Created",
"Date Expired": "Date Expired",
"Type": "Type",
"Features": "Features",
"Connected iOS Devices": "Connected iOS Devices",
"ID": "ID",
"iOS Version": "iOS Version",
"CPU Architecture": "CPU Architecture",
"NOTE: The following Android information has been detected using the old environment detection logic. To display more accurate information, install and select a Titanium SDK 3.2 or newer.": "NOTE: The following Android information has been detected using the old environment detection logic. To display more accurate information, install and select a Titanium SDK 3.2 or newer.",
"Android SDK": "Android SDK",
"Android Executable": "Android Executable",
Expand Down Expand Up @@ -136,7 +142,6 @@
"OpenGL Acceleration": "OpenGL Acceleration",
"unknown, emulator not running": "unknown, emulator not running",
"Connected Android Devices": "Connected Android Devices",
"ID": "ID",
"logs into the Appcelerator network": "logs into the Appcelerator network",
"user to log in as, if not already logged in": "user to log in as, if not already logged in",
"Username": "Username",
Expand Down

0 comments on commit 90f6a76

Please sign in to comment.