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
88e065de
Commit
88e065de
authored
Oct 17, 2016
by
Yegor
Committed by
GitHub
Oct 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
driver: forward device logs to local console (#6360)
Fixes #4261
parent
48690d7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+13
-0
No files found.
packages/flutter_tools/lib/src/commands/drive.dart
View file @
88e065de
...
...
@@ -83,6 +83,10 @@ class DriveCommand extends RunCommandBase {
Device
_device
;
Device
get
device
=>
_device
;
/// Subscription to log messages printed on the device or simulator.
// ignore: cancel_subscriptions
StreamSubscription
<
String
>
_deviceLogSubscription
;
int
get
debugPort
=>
int
.
parse
(
argResults
[
'debug-port'
]);
@override
...
...
@@ -306,6 +310,10 @@ Future<int> startApp(DriveCommand command) async {
platformArgs
[
'trace-startup'
]
=
command
.
traceStartup
;
printTrace
(
'Starting application.'
);
// Forward device log messages to the terminal window running the "drive" command.
command
.
_deviceLogSubscription
=
command
.
device
.
logReader
.
logLines
.
listen
(
printStatus
);
LaunchResult
result
=
await
command
.
device
.
startApp
(
package
,
command
.
getBuildMode
(),
...
...
@@ -319,6 +327,10 @@ Future<int> startApp(DriveCommand command) async {
platformArgs:
platformArgs
);
if
(!
result
.
started
)
{
await
command
.
_deviceLogSubscription
.
cancel
();
}
return
result
.
started
?
0
:
2
;
}
...
...
@@ -352,5 +364,6 @@ Future<int> stopApp(DriveCommand command) async {
printTrace
(
'Stopping application.'
);
ApplicationPackage
package
=
command
.
applicationPackages
.
getPackageForPlatform
(
command
.
device
.
platform
);
bool
stopped
=
await
command
.
device
.
stopApp
(
package
);
await
command
.
_deviceLogSubscription
?.
cancel
();
return
stopped
?
0
:
1
;
}
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