diff --git a/bin/templates/cordova/lib/Adb.js b/bin/templates/cordova/lib/Adb.js index 965b4f3e..042a0c2a 100644 --- a/bin/templates/cordova/lib/Adb.js +++ b/bin/templates/cordova/lib/Adb.js @@ -83,10 +83,9 @@ Adb.shell = function (target, shellCommand) { events.emit('verbose', 'Running adb shell command "' + shellCommand + '" on target ' + target + '...'); var args = ['-s', target, 'shell']; shellCommand = shellCommand.split(/\s+/); - return execa('adb', args.concat(shellCommand), { cwd: os.tmpdir() }).catch((error) => { - return Promise.reject(new CordovaError('Failed to execute shell command "' + - shellCommand + '"" on device: ' + error)); - }); + return execa('adb', args.concat(shellCommand), { cwd: os.tmpdir() }) + .then(({ stdout }) => stdout) + .catch(error => Promise.reject(new CordovaError(`Failed to execute shell command "${shellCommand}" on device: ${error}`))); }; Adb.start = function (target, activityName) {