Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
26906240
Commit
26906240
authored
Apr 11, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix an issue parsing adb devices (#3235)
parent
50461079
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
28 deletions
+25
-28
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+23
-26
setup_xcodeproj.dart
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
+1
-1
template.dart
packages/flutter_tools/lib/src/template.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
26906240
...
...
@@ -473,27 +473,23 @@ List<AndroidDevice> getAdbDevices() {
List
<
String
>
output
=
runSync
(<
String
>[
adbPath
,
'devices'
,
'-l'
]).
trim
().
split
(
'
\n
'
);
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
RegExp
deviceReg
ex1
=
new
RegExp
(
RegExp
deviceReg
ExLong
=
new
RegExp
(
r'^(\S+)\s+device\s+.*product:(\S+)\s+model:(\S+)\s+device:(\S+)$'
);
// 0149947A0D01500C device usb:340787200X
RegExp
deviceRegex2
=
new
RegExp
(
r'^(\S+)\s+device\s+\S+$'
);
RegExp
unauthorizedRegex
=
new
RegExp
(
r'^(\S+)\s+unauthorized\s+\S+$'
);
RegExp
offlineRegex
=
new
RegExp
(
r'^(\S+)\s+offline\s+\S+$'
);
// Skip the first line, which is always 'List of devices attached'.
for
(
String
line
in
output
.
skip
(
1
))
{
// Skip lines like:
// * daemon not running. starting it now on port 5037 *
// * daemon started successfully *
// emulator-5612 host features:shell_2
RegExp
deviceRegExShort
=
new
RegExp
(
r'^(\S+)\s+(\S+)\s+\S+$'
);
for
(
String
line
in
output
)
{
// Skip lines like: * daemon started successfully *
if
(
line
.
startsWith
(
'* daemon '
))
continue
;
if
(
line
.
startsWith
(
'List of devices'
))
continue
;
if
(
deviceReg
ex1
.
hasMatch
(
line
))
{
Match
match
=
deviceReg
ex1
.
firstMatch
(
line
);
if
(
deviceReg
ExLong
.
hasMatch
(
line
))
{
Match
match
=
deviceReg
ExLong
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
String
productID
=
match
[
2
];
String
modelID
=
match
[
3
];
...
...
@@ -508,21 +504,21 @@ List<AndroidDevice> getAdbDevices() {
modelID:
modelID
,
deviceCodeName:
deviceCodeName
));
}
else
if
(
deviceRegex2
.
hasMatch
(
line
))
{
Match
match
=
deviceRegex2
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
devices
.
add
(
new
AndroidDevice
(
deviceID
));
}
else
if
(
unauthorizedRegex
.
hasMatch
(
line
))
{
Match
match
=
unauthorizedRegex
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
printError
(
'Device
$deviceID
is not authorized.
\n
'
'You might need to check your device for an authorization dialog.'
);
}
else
if
(
offlineRegex
.
hasMatch
(
line
))
{
Match
match
=
offlineRegex
.
firstMatch
(
line
);
}
else
if
(
deviceRegExShort
.
hasMatch
(
line
))
{
Match
match
=
deviceRegExShort
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
printError
(
'Device
$deviceID
is offline.'
);
String
deviceState
=
match
[
2
];
if
(
deviceState
==
'unauthorized'
)
{
printError
(
'Device
$deviceID
is not authorized.
\n
'
'You might need to check your device for an authorization dialog.'
);
}
else
if
(
deviceState
==
'offline'
)
{
printError
(
'Device
$deviceID
is offline.'
);
}
else
{
devices
.
add
(
new
AndroidDevice
(
deviceID
));
}
}
else
{
printError
(
'Unexpected failure parsing device information from adb output:
\n
'
...
...
@@ -530,6 +526,7 @@ List<AndroidDevice> getAdbDevices() {
'Please report a bug at https://github.com/flutter/flutter/issues/new'
);
}
}
return
devices
;
}
...
...
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
View file @
26906240
...
...
@@ -8,8 +8,8 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'../artifacts.dart'
;
import
'../build_configuration.dart'
;
import
'../base/process.dart'
;
import
'../build_configuration.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command_runner.dart'
;
...
...
packages/flutter_tools/lib/src/template.dart
View file @
26906240
...
...
@@ -4,8 +4,8 @@
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
import
'package:mustache4dart/mustache4dart.dart'
as
mustache
;
import
'package:path/path.dart'
as
path
;
import
'artifacts.dart'
;
import
'globals.dart'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment