Repository: cordova-android Updated Branches: refs/heads/master 9f1aedb56 -> 457c5b8b3
CB-9710: Fixing issues parsing `android avd list` output for certain AVDs which resulted in them not being included in the selection process even if they are the best match. This closes 221 Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/457c5b8b Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/457c5b8b Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/457c5b8b Branch: refs/heads/master Commit: 457c5b8b3b694265c991b456b15015741ade5014 Parents: 9f1aedb Author: Roberto Andrade <robe...@cloud.com> Authored: Sat Sep 26 08:18:16 2015 -0400 Committer: Joe Bowser <bows...@apache.org> Committed: Wed Mar 16 09:32:24 2016 -0700 ---------------------------------------------------------------------- bin/templates/cordova/lib/emulator.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-android/blob/457c5b8b/bin/templates/cordova/lib/emulator.js ---------------------------------------------------------------------- diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js index 96bb5c9..1a07236 100644 --- a/bin/templates/cordova/lib/emulator.js +++ b/bin/templates/cordova/lib/emulator.js @@ -62,13 +62,18 @@ module.exports.list_images = function() { var img_obj = {}; if (response[i].match(/Name:\s/)) { img_obj['name'] = response[i].split('Name: ')[1].replace('\r', ''); + if (response[i + 1].match(/Device:\s/)) { + i++; + img_obj['device'] = response[i].split('Device: ')[1].replace('\r', ''); + } if (response[i + 1].match(/Path:\s/)) { i++; img_obj['path'] = response[i].split('Path: ')[1].replace('\r', ''); } - if (response[i + 1].match(/\(API\slevel\s/)) { + if (response[i + 1].match(/\(API\slevel\s/) || response[i + 2].match(/\(API\slevel\s/)) { i++; - img_obj['target'] = response[i].replace('\r', ''); + var secondLine = response[i + 1].match(/\(API\slevel\s/) ? response[i + 1] : ''; + img_obj['target'] = (response[i] + secondLine).split('Target: ')[1].replace('\r', ''); } if (response[i + 1].match(/ABI:\s/)) { i++; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org