fix (adb): shell to return expected stdout (#904)

This commit is contained in:
エリス 2020-01-21 23:37:22 +09:00 committed by GitHub
parent 8ef742e79d
commit 0924654a47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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