Commit graph

13 commits

Author SHA1 Message Date
Danny Tuppeny d3f6128c21
Flutter emulator launch crash running in dart-2-mode (#19454)
* Only printError on our simple messages

Any other type is a real error that should be a normal crash (to get a proper error log).

See #19453.

* Add toList() to convert Iterable<String> -> List<String>

This code previously throw in Dart-2 mode.

Fixes #19453.

* Move getSimulatorPath into Xcode

* Add a test that we tried to launch the simulator

* Remove unused import
2018-07-19 10:32:44 +01:00
Ian Hickson f630f90d6d
Revert "enable lint unnecessary_const (#19342)" (#19423)
This reverts commit cc1cf13eec.
2018-07-16 13:30:27 -07:00
Alexandre Ardhuin cc1cf13eec
enable lint unnecessary_const (#19342) 2018-07-16 21:43:48 +02:00
Danny Tuppeny cdb01187f8
Add --create option to flutter emulators command (#18235)
* Add --create option to flutter emulators

* Tweaks to error message

* Simplify emulator search logic

* Make name optional

* Add a note about this option being used with --create

* Tweaks to help information

* Switch to processManager for easier testing

* Don't crash on missing files or missing properties in Android Emulator

* Move name suffixing into emulator manager

This allows it to be tested in the EmulatorManager tests and also used by daemon later if desired.

* Pass the context's android SDK through so it can be mocked by tests

* Misc fixes

* Add tests around emulator creation

Process calls are mocked to avoid needing a real SDK (and to be fast). Full integration tests may be useful, but may require ensuring all build environments etc. are set up correctly.

* Simplify avdManagerPath

Previous changes were to emulatorPath!

* Fix lint errors

* Fix incorrect file exgtension for Windows

* Fix an issue where no system images would crash

reduce throws on an empty collection.

* Fix "null" appearing in error messages

The name we attempted to use will now always be returned, even in the case of failure.

* Add additional info to missing-system-image failure message

On Windows after installing Andriod Studio I didn't have any of these and got this message. Installing with sdkmanager fixed the issue.

* Fix thrown errors

runResult had a toString() but we moved to ProcessResult when switching to ProcessManager to this ended up throwing "Instance of ProcessResult".

* Fix package import

* Fix more package imports

* Move mock implementation into Mock class

There seemed to be issues using Lists in args with Mockito that I couldn't figure out (docs say to use typed() but I couldn't make this compile with these lists still)..

* Rename method that's ambigious now we have create

* Handle where there's no avd path

* Add another toList() :(

* Remove comment that was rewritten

* Fix forbidden import

* Make optional arg more obviously optional

* Reformat doc

* Note that we create a pixel device in help text

* Make this a named arg
2018-06-28 08:07:40 +01:00
Danny Tuppeny 48f4ff6dda
Ensure errors launching emulators are exposed to the daemon (#18446) 2018-06-14 07:59:50 +01:00
Danny Tuppeny e2181a6ad9
First run simulator with -n to ensure it always opens a device (#17460) 2018-05-22 07:35:42 +01:00
Danny Tuppeny e8f454c96f Fix signature of mock launch 2018-05-09 16:03:59 +01:00
Danny Tuppeny 3cb539fdb5 Switch streams to Future<Lists> 2018-05-09 16:03:59 +01:00
Danny Tuppeny e456330a91 Remove superflous whitespace 2018-05-09 16:03:59 +01:00
Danny Tuppeny 445273f7d5 Fix filtering of emulator list
`flutter emulators nexus` will now return only those that'd match (eg. same things that `flutter emulators --start nexus` would match).
2018-05-09 16:03:59 +01:00
Danny Tuppeny 4c67885b8e Add support for launching emulators 2018-05-09 16:03:59 +01:00
Danny Tuppeny 4d7c3c775f Read information about AVDs from config.ini 2018-05-09 16:03:59 +01:00
Danny Tuppeny 486e9534bf Add some emulator tests 2018-05-09 16:03:59 +01:00