Skip to content

Commit

Permalink
Merge pull request #6072 from cb1kenobi/timob-17595_3_4_X
Browse files Browse the repository at this point in the history
[TIMOB-17595] Improved iOS device build experience
  • Loading branch information
skypanther committed Sep 14, 2014
2 parents 445f1f4 + a814aa1 commit 66fb1d5
Show file tree
Hide file tree
Showing 48 changed files with 6,422 additions and 235 deletions.
1 change: 0 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ iOSBuilder.prototype.config = function config(logger, config, cli) {
// squelch and let the cli detect the bad version
}
},
default: defaultIosVersion,
desc: __('iOS SDK version to build with'),
order: 130,
prompt: function (callback) {
Expand Down
55 changes: 38 additions & 17 deletions iphone/cli/hooks/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports.init = function (logger, config, cli) {
}
},
function (next) {
ioslib.device.detect(function (err, results) {
ioslib.device.detect({ bypassCache: true }, function (err, results) {
if (!err) {
results.devices.forEach(function (device) {
if (device.udid !== 'itunes' && device.udid !== 'all' && (builder.deviceId === 'all' || device.udid === builder.deviceId)) {
Expand All @@ -59,7 +59,7 @@ exports.init = function (logger, config, cli) {

// if we don't have a deviceId, or it's "itunes", or it's "all", but not devices are connected,
// then install to iTunes
if (!builder.deviceId || builder.deviceId === 'itunes' || (builder.deviceId === 'all' && !Object.keys(devices).length)) {
if (!builder.deviceId || builder.deviceId === 'itunes' || (builder.deviceId && !Object.keys(devices).length)) {
logger.info(__('Installing application into iTunes'));

var ipa = path.join(path.dirname(builder.xcodeAppDir), builder.tiapp.name + '.ipa');
Expand Down Expand Up @@ -95,7 +95,8 @@ exports.init = function (logger, config, cli) {
logLevelRE = new RegExp('^(\u001b\\[\\d+m)?\\[?(' + levels.join('|') + '|log|timestamp)\\]?\s*(\u001b\\[\\d+m)?(.*)', 'i'),
startLog = false,
running = 0,
installed = 0;
disconnected = false,
installCount = 0;

function quit(force) {
if (force || (running <= 0 && startLog)) {
Expand All @@ -105,28 +106,34 @@ exports.init = function (logger, config, cli) {
}
}

function showStartMessage() {
if (++installCount === udids.length && !startLog) {
setTimeout(function () {
if (process.env.STUDIO_VERSION) {
logger.log(__('Please manually launch the application').magenta + '\n');
} else {
logger.log(__('Please manually launch the application or press CTRL-C to quit').magenta + '\n');
}
}, 50);
}
}

// install the app for the specified device or "all" devices
async.eachSeries(udids, function (udid, next) {
var device = devices[udid],
lastLogger = 'debug';
lastLogger = 'debug',
installed = false;

logger.info(__('Installing app on device: %s', device.name.cyan));

ioslib.device.install(udid, builder.xcodeAppDir, builder.tiapp.id, {
appName: builder.tiapp.name
}).on('installed', function () {
installed = true;
logger.info(__('App successfully installed on device: %s', device.name.cyan));
next && next();
next = null;
if (++installed === udids.length && !startLog) {
setTimeout(function () {
if (process.env.STUDIO_VERSION) {
logger.log(__('Please manually launch the application').magenta + '\n');
} else {
logger.log(__('Please manually launch the application or press CTRL-C to quit').magenta + '\n');
}
}, 50);
}
showStartMessage();
}).on('app-started', function () {
if (!startLog) {
var startLogTxt = __('Start application log');
Expand Down Expand Up @@ -161,13 +168,27 @@ exports.init = function (logger, config, cli) {
running--;
quit();
}).on('error', function (err) {
err = err.message || err;
logger.error(err);
if (err.indexOf('0xe8008017') !== -1) {
logger.error(__('Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device'));
if (!installed) {
// was the device connected?
err = null;
if (!disconnected) {
logger.warn(__('The device %s is no longer connected, skipping', device.name.cyan));
showStartMessage();
}
} else {
err = err.message || err;
logger.error(err);
if (err.indexOf('0xe8008017') !== -1) {
logger.error(__('Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device'));
}
}
next && next(err);
next = null;
}).on('disconnect', function () {
disconnected = true;
logger.warn(__('The device %s is no longer connected, skipping', device.name.cyan));
next && next();
next = null;
});
}, finished);

Expand Down
9 changes: 5 additions & 4 deletions iphone/cli/lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,11 @@ exports.render = function (logger, config, rpad, styleHeading, styleValue, style
}

logger.log(styleHeading(__('Connected iOS Devices')));
if (data.devices.length) {
logger.log(data.devices.filter(function (device) {
return device.udid !== 'itunes';
}).map(function (device) {
var devices = data.devices.filter(function (device) {
return device.udid !== 'itunes';
});
if (devices.length) {
logger.log(devices.map(function (device) {
return ' ' + device.name.cyan + '\n' + [
' ' + rpad(' ' + __('UDID')) + ' = ' + styleValue(device.udid),
' ' + rpad(' ' + __('Type')) + ' = ' + styleValue(device.deviceClass + ' (' + device.deviceColor + ')'),
Expand Down
78 changes: 27 additions & 51 deletions iphone/cli/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"identical to the %s flag, except this will also copy the %s libTiCore.a file": "identical to the %s flag, except this will also copy the %s libTiCore.a file",
"use the retina version of the iOS Simulator": "use the retina version of the iOS Simulator",
"use the 64-bit version of the iOS Simulator": "use the 64-bit version of the iOS Simulator",
"focus the iOS Simulator": "focus the iOS Simulator",
"in combination with %s flag, start the tall version of the retina device": "in combination with %s flag, start the tall version of the retina device",
"the type of deployment; only used when target is %s or %s": "the type of deployment; only used when target is %s or %s",
"type": "type",
"the name of the iOS simulator or the device udid to install the application to; for %s builds %s; for %s builds %s": "the name of the iOS simulator or the device udid to install the application to; for %s builds %s; for %s builds %s",
"name": "name",
"the udid of the iOS simulator or iOS device to install the application to; for %s builds %s": "the udid of the iOS simulator or iOS device to install the application to; for %s builds %s",
"udid": "udid",
"Available iOS Devices:": "Available iOS Devices:",
"Available iOS Simulators:": "Available iOS Simulators:",
"Which device do you want to install your app on?": "Which device do you want to install your app on?",
"Select an device by number or name": "Select an device by number or name",
"Which simulator do you want to launch your app in?": "Which simulator do you want to launch your app in?",
Expand Down Expand Up @@ -84,7 +87,12 @@
"Available keychains:": "Available keychains:",
"No device family specified, defaulting to %s": "No device family specified, defaulting to %s",
"Invalid device family \"%s\"": "Invalid device family \"%s\"",
"Unable to build an %s app for an %s simulator": "Unable to build an %s app for an %s simulator",
"Please specify \"%s\" to launch a compatible iOS Simulator.": "Please specify \"%s\" to launch a compatible iOS Simulator.",
"Unable to find any Xcode installs that has iOS SDK %s and iOS Simulator %s": "Unable to find any Xcode installs that has iOS SDK %s and iOS Simulator %s",
"Unable to find any Xcode installs that has iOS SDK %s": "Unable to find any Xcode installs that has iOS SDK %s",
"Available iOS SDKs and iOS Simulators:": "Available iOS SDKs and iOS Simulators:",
"iOS %s:": "iOS %s:",
"Invalid %s host \"%s\"": "Invalid %s host \"%s\"",
"The %s host must be in the format \"host:port\".": "The %s host must be in the format \"host:port\".",
"The %s host must be in the format \"host:port:airkey:hosts\".": "The %s host must be in the format \"host:port:airkey:hosts\".",
Expand All @@ -103,8 +111,11 @@
"Building for target: %s": "Building for target: %s",
"Building using iOS SDK: %s": "Building using iOS SDK: %s",
"Performing build only": "Performing build only",
"Building for iOS %s Simulator: %s": "Building for iOS %s Simulator: %s",
"Building for device: %s": "Building for device: %s",
"Building for iOS Simulator: %s": "Building for iOS Simulator: %s",
"UDID: %s": "UDID: %s",
"Simulator type: %s": "Simulator type: %s",
"Simulator version: %s": "Simulator version: %s",
"Building for iOS device: %s": "Building for iOS device: %s",
"Building for device family: %s": "Building for device family: %s",
"Setting Xcode target to %s": "Setting Xcode target to %s",
"Setting Xcode build OS to %s": "Setting Xcode build OS to %s",
Expand Down Expand Up @@ -132,6 +143,7 @@
"Forcing rebuild: incomplete version file %s": "Forcing rebuild: incomplete version file %s",
"Forcing rebuild: libTiCore hash changed since last build": "Forcing rebuild: libTiCore hash changed since last build",
"Forcing rebuild: Titanium SDK path changed since last build": "Forcing rebuild: Titanium SDK path changed since last build",
"Forcing rebuild: iOS SDK version changed since last build": "Forcing rebuild: iOS SDK version changed since last build",
"Forcing rebuild: device family changed since last build": "Forcing rebuild: device family changed since last build",
"Forcing rebuild: githash changed since last build": "Forcing rebuild: githash changed since last build",
"Forcing rebuild: JavaScript files need to be re-encrypted": "Forcing rebuild: JavaScript files need to be re-encrypted",
Expand Down Expand Up @@ -207,72 +219,39 @@
"Failed to launch iTunes": "Failed to launch iTunes",
"Initiating iTunes sync": "Initiating iTunes sync",
"Failed to initiate iTunes sync": "Failed to initiate iTunes sync",
"Waiting for device logs to sync": "Waiting for device logs to sync",
"Installing app on device: %s": "Installing app on device: %s",
"Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device": "Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device",
"App successfully installed on device: %s": "App successfully installed on device: %s",
"End application log": "End application log",
"Please manually launch the application": "Please manually launch the application",
"Please manually launch the application or press CTRL-C to quit": "Please manually launch the application or press CTRL-C to quit",
"Installing app on device: %s": "Installing app on device: %s",
"App successfully installed on device: %s": "App successfully installed on device: %s",
"Start application log": "Start application log",
"End application log": "End application log",
"The device %s is no longer connected, skipping": "The device %s is no longer connected, skipping",
"Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device": "Chances are there is a signing issue with your provisioning profile or the generated app is not compatible with your device",
"Archiving app bundle to %s": "Archiving app bundle to %s",
"Archiving debug symbols to %s": "Archiving debug symbols to %s",
"Launching Xcode: %s": "Launching Xcode: %s",
"Packaging complete": "Packaging complete",
"Failed to package application": "Failed to package application",
"Package location: %s": "Package location: %s",
"Performed build only, skipping running of the application": "Performed build only, skipping running of the application",
"Running application in iOS Simulator": "Running application in iOS Simulator",
"Terminating all iOS simulators": "Terminating all iOS simulators",
"Removing old log file: %s": "Removing old log file: %s",
"Launching application in iOS Simulator": "Launching application in iOS Simulator",
"Simulator command: %s": "Simulator command: %s",
"Launching iOS Simulator": "Launching iOS Simulator",
"Start simulator log": "Start simulator log",
"End simulator log": "End simulator log",
"An error occurred running the iOS Simulator": "An error occurred running the iOS Simulator",
"Application has exited from iOS Simulator": "Application has exited from iOS Simulator",
"Focusing the iOS Simulator": "Focusing the iOS Simulator",
"Failed to focus the iPhone Simulator window": "Failed to focus the iPhone Simulator window",
"Found iPhone Simulator log file: %s": "Found iPhone Simulator log file: %s",
"Start simulator log": "Start simulator log",
"Unable to find the 'xcode-select' executable": "Unable to find the 'xcode-select' executable",
"Perhaps Xcode is not installed, your Xcode installation is corrupt, or your system path is incomplete.": "Perhaps Xcode is not installed, your Xcode installation is corrupt, or your system path is incomplete.",
"If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.xcodeSelect /path/to/xcode-select'.": "If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.xcodeSelect /path/to/xcode-select'.",
"Unable to find the 'security' executable": "Unable to find the 'security' executable",
"Please verify your system path.": "Please verify your system path.",
"This program is distributed with Mac OS X and if it's missing, you'll have to restore it from a backup or another computer, or reinstall Mac OS X.": "This program is distributed with Mac OS X and if it's missing, you'll have to restore it from a backup or another computer, or reinstall Mac OS X.",
"If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.security /path/to/security'.": "If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.security /path/to/security'.",
"If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.xcodeSelect /path/to/xcode-select'.": "If you know where this executable is, you can tell the Titanium CLI where it located by running 'titanium config osx.executables.xcodeSelect /path/to/xcode-select'.",
"Xcode %s is too old and is no longer supported by Titanium SDK %s.": "Xcode %s is too old and is no longer supported by Titanium SDK %s.",
"The minimum supported Xcode version by Titanium SDK %s is Xcode %s.": "The minimum supported Xcode version by Titanium SDK %s is Xcode %s.",
"Xcode %s may or may not work with Titanium SDK %s.": "Xcode %s may or may not work with Titanium SDK %s.",
"The maximum supported Xcode version by Titanium SDK %s is Xcode %s.": "The maximum supported Xcode version by Titanium SDK %s is Xcode %s.",
"There are no Xcode installations found that are supported by Titanium SDK %s.": "There are no Xcode installations found that are supported by Titanium SDK %s.",
"There are no iOS SDKs found": "There are no iOS SDKs found",
"Launch Xcode and download the mobile support packages.": "Launch Xcode and download the mobile support packages.",
"There are no iOS Simulators found": "There are no iOS Simulators found",
"You can install them from the Xcode Preferences > Downloads tab.": "You can install them from the Xcode Preferences > Downloads tab.",
"No Xcode installations found.": "No Xcode installations found.",
"You can download it from the %s or from %s.": "You can download it from the %s or from %s.",
"Apple’s World Wide Developer Relations (WWDR) intermediate certificate is not installed.": "Apple’s World Wide Developer Relations (WWDR) intermediate certificate is not installed.",
"This will prevent you from building apps for iOS devices or package for distribution.": "This will prevent you from building apps for iOS devices or package for distribution.",
"Unable to find any keychains found.": "Unable to find any keychains found.",
"Titanium will most likely not be able to detect any developer or distribution certificates.": "Titanium will most likely not be able to detect any developer or distribution certificates.",
"Unable to find any valid iOS developer certificates.": "Unable to find any valid iOS developer certificates.",
"This will prevent you from building apps for iOS devices.": "This will prevent you from building apps for iOS devices.",
"You will need to login into %s with your Apple Download account, then create, download, and install a certificate.": "You will need to login into %s with your Apple Download account, then create, download, and install a certificate.",
"Unable to find any valid iOS production distribution certificates.": "Unable to find any valid iOS production distribution certificates.",
"This will prevent you from packaging apps for distribution.": "This will prevent you from packaging apps for distribution.",
"Unable to find any valid iOS development provisioning profiles.": "Unable to find any valid iOS development provisioning profiles.",
"This will prevent you from building apps for testing on iOS devices.": "This will prevent you from building apps for testing on iOS devices.",
"Unable to find any valid iOS adhoc provisioning profiles.": "Unable to find any valid iOS adhoc provisioning profiles.",
"This will prevent you from packaging apps for adhoc distribution.": "This will prevent you from packaging apps for adhoc distribution.",
"Unable to find any valid iOS distribution provisioning profiles.": "Unable to find any valid iOS distribution provisioning profiles.",
"This will prevent you from packaging apps for AppStore distribution.": "This will prevent you from packaging apps for AppStore distribution.",
"iTunes Sync": "iTunes Sync",
"Xcode": "Xcode",
"Install Location": "Install Location",
"iOS SDKs": "iOS SDKs",
"iOS Simulators": "iOS Simulators",
"Supported by TiSDK %s": "Supported by TiSDK %s",
"No Xcode installations found.": "No Xcode installations found.",
"iOS Keychains": "iOS Keychains",
"iOS Development Certificates": "iOS Development Certificates",
"**EXPIRED**": "**EXPIRED**",
Expand All @@ -291,12 +270,9 @@
"Development iOS Provisioning Profiles": "Development iOS Provisioning Profiles",
"Distribution iOS Provisioning Profiles": "Distribution iOS Provisioning Profiles",
"Ad Hoc iOS Provisioning Profiles": "Ad Hoc iOS Provisioning Profiles",
"Type": "Type",
"iOS Versions": "iOS Versions",
"Architecture": "Architecture",
"Features": "Features",
"UDID": "UDID",
"Connected iOS Devices": "Connected iOS Devices",
"ID": "ID",
"Type": "Type",
"iOS Version": "iOS Version",
"CPU Architecture": "CPU Architecture"
}
1 change: 1 addition & 0 deletions mobileweb/cli/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"Java can be downloaded and installed from %s": "Java can be downloaded and installed from %s",
"the type of deployment; production performs optimizations": "the type of deployment; production performs optimizations",
"type": "type",
"Winstore apps are only supported on Windows 8 and newer.": "Winstore apps are only supported on Windows 8 and newer.",
"the target to build for": "the target to build for",
"Unable to find any supported Windows Phone devices or emulators": "Unable to find any supported Windows Phone devices or emulators",
"Run \"ti info\" for more info.": "Run \"ti info\" for more info.",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/ioslib/node_modules/node-ios-device/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66fb1d5

Please sign in to comment.