mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
make sdb getprop less verbose (#4053)
This commit is contained in:
parent
95f838b072
commit
3b3b0ff1bb
@ -56,14 +56,15 @@ class AndroidDevice extends Device {
|
|||||||
if (_properties == null) {
|
if (_properties == null) {
|
||||||
_properties = <String, String>{};
|
_properties = <String, String>{};
|
||||||
|
|
||||||
try {
|
List<String> propCommand = adbCommandForDevice(<String>['shell', 'getprop']);
|
||||||
String getpropOutput = runCheckedSync(adbCommandForDevice(<String>['shell', 'getprop']));
|
printTrace(propCommand.join(' '));
|
||||||
|
ProcessResult result = Process.runSync(propCommand.first, propCommand.sublist(1));
|
||||||
|
if (result.exitCode == 0) {
|
||||||
RegExp propertyExp = new RegExp(r'\[(.*?)\]: \[(.*?)\]');
|
RegExp propertyExp = new RegExp(r'\[(.*?)\]: \[(.*?)\]');
|
||||||
for (Match m in propertyExp.allMatches(getpropOutput))
|
for (Match match in propertyExp.allMatches(result.stdout))
|
||||||
_properties[m.group(1)] = m.group(2);
|
_properties[match.group(1)] = match.group(2);
|
||||||
} catch (error, trace) {
|
} else {
|
||||||
printError('Error retrieving device properties: $error');
|
printError('Error retrieving device properties for $name.');
|
||||||
printTrace(trace.toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user