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
3d7f2126
Commit
3d7f2126
authored
Oct 29, 2015
by
Todd Volkert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #142 from flutter/issue_141
Wait for sky server to start before starting device
parents
79ceee73
a57109be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
device.dart
packages/flutter_tools/lib/src/device.dart
+12
-2
No files found.
packages/flutter_tools/lib/src/device.dart
View file @
3d7f2126
...
...
@@ -5,6 +5,7 @@
library
sky_tools
.
device
;
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:math'
;
...
...
@@ -512,6 +513,9 @@ class AndroidDevice extends Device {
static
const
String
className
=
'AndroidDevice'
;
static
final
String
defaultDeviceID
=
'default_android_device'
;
static
const
String
_kFlutterServerStartMessage
=
'Serving'
;
static
const
Duration
_kFlutterServerTimeout
=
const
Duration
(
seconds:
3
);
String
productID
;
String
modelID
;
String
deviceCodeName
;
...
...
@@ -773,8 +777,14 @@ class AndroidDevice extends Device {
[
adbPath
,
'forward'
,
observatoryPortString
,
observatoryPortString
]);
// Actually start the server.
await
Process
.
start
(
sdkBinaryName
(
'pub'
),
[
'run'
,
'sky_tools:sky_server'
,
_serverPort
],
workingDirectory:
serverRoot
,
mode:
ProcessStartMode
.
DETACHED
);
Process
server
=
await
Process
.
start
(
sdkBinaryName
(
'pub'
),
[
'run'
,
'sky_tools:sky_server'
,
_serverPort
],
workingDirectory:
serverRoot
,
mode:
ProcessStartMode
.
DETACHED_WITH_STDIO
);
await
server
.
stdout
.
transform
(
UTF8
.
decoder
)
.
firstWhere
((
String
value
)
=>
value
.
startsWith
(
_kFlutterServerStartMessage
))
.
timeout
(
_kFlutterServerTimeout
);
// Set up reverse port-forwarding so that the Android app can reach the
// server running on localhost.
...
...
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