File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -228,10 +228,20 @@ export class AndroidDeviceManager {
228228 */
229229 // eslint-disable-next-line class-methods-use-this
230230 private getAvdDefinitions ( rawString : string ) : CaseInsensitiveStringMap [ ] {
231- const input = rawString . replace (
232- '\n\nThe following Android Virtual Devices could not be loaded:' ,
233- '\n---------'
234- ) ;
231+ // While 'avdmanager list avd' may not have been able to parse some info about
232+ // some AVDs and may list those under the section marked as "could not load",
233+ // when we actually want to interact with those AVDs, most of the time ADB may
234+ // (and often actually can) interact with those AVDs. So even though avdmanager
235+ // lists these under the "could not load" section, we would still want to parse
236+ // the AVDs listed there and include them in our results.
237+ let input = rawString . replace ( '\n\nThe following Android Virtual Devices could not be loaded:' , '\n---------' ) ;
238+
239+ // Find the location where the info about AVDs start
240+ const startIdx = input . indexOf ( 'Available Android Virtual Devices' ) ;
241+ if ( startIdx > 0 ) {
242+ input = input . substring ( startIdx ) ;
243+ }
244+
235245 const lines = input . trim ( ) . split ( '\n' ) . slice ( 1 ) ; // skip the first line which is superficial line not containing any AVD data
236246 const separatorPattern = / ^ - + $ / ; // Regex to match separator lines with 2 or more dashes
237247 const chunks : string [ ] = [ ] ; // Array to hold the chunks
You can’t perform that action at this time.
0 commit comments