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
fd6bc856
Commit
fd6bc856
authored
Nov 18, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #458 from abarth/adb_errors
Handle adb error cases more gracefully
parents
b20a1f4a
3027497f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
flutter
bin/flutter
+6
-0
device.dart
packages/flutter_tools/lib/src/device.dart
+17
-0
No files found.
bin/flutter
View file @
fd6bc856
...
...
@@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set
-e
export
FLUTTER_ROOT
=
$(
dirname
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
))
FLUTTER_TOOLS_DIR
=
"
$FLUTTER_ROOT
/packages/flutter_tools"
SNAPSHOT_PATH
=
"
$FLUTTER_ROOT
/bin/cache/flutter_tools.snapshot"
...
...
@@ -20,6 +22,8 @@ if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -f "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"`
echo
-n
$REVISION
>
"
$STAMP_PATH
"
fi
set
+e
$DART
"
$SNAPSHOT_PATH
"
"
$@
"
# The VM exits with code 253 if the snapshot version is out-of-date.
...
...
@@ -29,5 +33,7 @@ if [ $EXIT_CODE != 253 ]; then
exit
$EXIT_CODE
fi
set
-e
$DART
--snapshot
=
"
$SNAPSHOT_PATH
"
--package-root
=
"
$FLUTTER_TOOLS_DIR
/packages"
"
$SCRIPT_PATH
"
$DART
"
$SNAPSHOT_PATH
"
"
$@
"
packages/flutter_tools/lib/src/device.dart
View file @
fd6bc856
...
...
@@ -505,6 +505,14 @@ class AndroidDevice extends Device {
static
List
<
AndroidDevice
>
getAttachedDevices
([
AndroidDevice
mockAndroid
])
{
List
<
AndroidDevice
>
devices
=
[];
String
adbPath
=
(
mockAndroid
!=
null
)
?
mockAndroid
.
adbPath
:
_getAdbPath
();
try
{
runCheckedSync
([
adbPath
,
'version'
]);
}
catch
(
e
)
{
_logging
.
severe
(
'Unable to find adb. Is "adb" in your path?'
);
return
devices
;
}
List
<
String
>
output
=
runSync
([
adbPath
,
'devices'
,
'-l'
]).
trim
().
split
(
'
\n
'
);
// 015d172c98400a03 device usb:340787200X product:nakasi model:Nexus_7 device:grouper
...
...
@@ -514,6 +522,8 @@ class AndroidDevice extends Device {
// 0149947A0D01500C device usb:340787200X
RegExp
deviceRegex2
=
new
RegExp
(
r'^(\S+)\s+device\s+\S+$'
);
RegExp
unauthorizedRegex
=
new
RegExp
(
r'^(\S+)\s+unauthorized$'
);
// Skip first line, which is always 'List of devices attached'.
for
(
String
line
in
output
.
skip
(
1
))
{
// Skip lines like:
...
...
@@ -539,6 +549,13 @@ class AndroidDevice extends Device {
Match
match
=
deviceRegex2
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
devices
.
add
(
new
AndroidDevice
(
id:
deviceID
));
}
else
if
(
unauthorizedRegex
.
hasMatch
(
line
))
{
Match
match
=
unauthorizedRegex
.
firstMatch
(
line
);
String
deviceID
=
match
[
1
];
_logging
.
warning
(
'Device
$deviceID
is not authorized.
\n
'
'You might need to check your device for an authorization dialog.'
);
}
else
{
_logging
.
warning
(
'Unexpected failure parsing device information from adb output:
\n
'
...
...
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