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
48f4ff6d
Unverified
Commit
48f4ff6d
authored
Jun 14, 2018
by
Danny Tuppeny
Committed by
GitHub
Jun 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure errors launching emulators are exposed to the daemon (#18446)
parent
03b5b1c0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
15 deletions
+17
-15
android_emulator.dart
packages/flutter_tools/lib/src/android/android_emulator.dart
+5
-8
emulators.dart
packages/flutter_tools/lib/src/commands/emulators.dart
+8
-3
emulator.dart
packages/flutter_tools/lib/src/emulator.dart
+1
-1
ios_emulators.dart
packages/flutter_tools/lib/src/ios/ios_emulators.dart
+2
-2
emulator_test.dart
packages/flutter_tools/test/emulator_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/android/android_emulator.dart
View file @
48f4ff6d
...
...
@@ -11,7 +11,6 @@ import '../android/android_workflow.dart';
import
'../base/file_system.dart'
;
import
'../base/process.dart'
;
import
'../emulator.dart'
;
import
'../globals.dart'
;
import
'android_sdk.dart'
;
class
AndroidEmulators
extends
EmulatorDiscovery
{
...
...
@@ -41,22 +40,20 @@ class AndroidEmulator extends Emulator {
String
get
label
=>
_properties
[
'avd.ini.displayname'
];
@override
Future
<
bool
>
launch
()
async
{
final
Future
<
bool
>
launchResult
=
Future
<
void
>
launch
()
async
{
final
Future
<
void
>
launchResult
=
runAsync
(<
String
>[
getEmulatorPath
(),
'-avd'
,
id
])
.
then
((
RunResult
runResult
)
{
if
(
runResult
.
exitCode
!=
0
)
{
printError
(
'
$runResult
'
);
return
false
;
throw
'
$runResult
'
;
}
return
true
;
});
// emulator continues running on a successful launch so if we
// haven't quit within 3 seconds we assume that's a success and just
// return.
return
Future
.
any
<
bool
>(<
Future
<
bool
>>[
return
Future
.
any
<
void
>(<
Future
<
void
>>[
launchResult
,
new
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
3
))
.
then
((
_
)
=>
true
)
new
Future
<
void
>.
delayed
(
const
Duration
(
seconds:
3
))
]);
}
}
...
...
packages/flutter_tools/lib/src/commands/emulators.dart
View file @
48f4ff6d
...
...
@@ -49,7 +49,7 @@ class EmulatorsCommand extends FlutterCommand {
}
}
Future
<
Null
>
_launchEmulator
(
String
id
)
async
{
Future
<
void
>
_launchEmulator
(
String
id
)
async
{
final
List
<
Emulator
>
emulators
=
await
emulatorManager
.
getEmulatorsMatching
(
id
);
...
...
@@ -61,11 +61,16 @@ class EmulatorsCommand extends FlutterCommand {
"More than one emulator matches '
$id
':"
,
);
}
else
{
await
emulators
.
first
.
launch
();
try
{
await
emulators
.
first
.
launch
();
}
catch
(
e
)
{
printError
(
e
);
}
}
}
Future
<
Null
>
_listEmulators
(
String
searchText
)
async
{
Future
<
void
>
_listEmulators
(
String
searchText
)
async
{
final
List
<
Emulator
>
emulators
=
searchText
==
null
?
await
emulatorManager
.
getAllAvailableEmulators
()
:
await
emulatorManager
.
getEmulatorsMatching
(
searchText
);
...
...
packages/flutter_tools/lib/src/emulator.dart
View file @
48f4ff6d
...
...
@@ -95,7 +95,7 @@ abstract class Emulator {
return
id
==
other
.
id
;
}
Future
<
bool
>
launch
();
Future
<
void
>
launch
();
@override
String
toString
()
=>
name
;
...
...
packages/flutter_tools/lib/src/ios/ios_emulators.dart
View file @
48f4ff6d
...
...
@@ -36,8 +36,8 @@ class IOSEmulator extends Emulator {
String
get
label
=>
null
;
@override
Future
<
bool
>
launch
()
async
{
Future
<
bool
>
launchSimulator
(
List
<
String
>
additionalArgs
)
async
{
Future
<
void
>
launch
()
async
{
Future
<
void
>
launchSimulator
(
List
<
String
>
additionalArgs
)
async
{
final
List
<
String
>
args
=
<
String
>[
'open'
]
.
followedBy
(
additionalArgs
)
.
followedBy
(<
String
>[
'-a'
,
getSimulatorPath
()]);
...
...
packages/flutter_tools/test/emulator_test.dart
View file @
48f4ff6d
...
...
@@ -62,7 +62,7 @@ class _MockEmulator extends Emulator {
final
String
label
;
@override
Future
<
bool
>
launch
()
{
Future
<
void
>
launch
()
{
throw
new
UnimplementedError
(
'Not implemented in Mock'
);
}
}
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