diff --git a/lib/units/ios-device/plugins/install.js b/lib/units/ios-device/plugins/install.js index a0f9e1933..46fed544e 100755 --- a/lib/units/ios-device/plugins/install.js +++ b/lib/units/ios-device/plugins/install.js @@ -70,14 +70,22 @@ export default syrup.serial() promiseutil.periodicNotify(installApp(options.serial, path), 250) .progressed(() => { guesstimate = Math.min(95, guesstimate + 1.5 * (95 - guesstimate) / 35) - sendProgress('installing_app', guesstimate) + sendProgress('installing_app', Math.round(guesstimate)) }) .then((result) => { push.send([channel, reply.okay('INSTALL_SUCCEEDED')]) if (message.launch) { - const bundleId = result.match(/.[\w.-]+[\w-]/) + const bundleId = String(result).match(/Installed:?\s+([\w.-]+)/i)?.[1] + if (!bundleId) { + log.warn('Unable to detect bundle id from idb install output: %s', result) + return + } + sendProgress('launching_app', 100) launchApp(options.serial, bundleId) + .catch((err) => { + log.warn('Application launch after install failed: %s', err.message) + }) } }) .catch((err) => {