Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jan 27, 2022

When an unsupported device is specified during a flutter -d command, fail, and show all devices so users can see that it was connected, but unsupported.

Note the (unsupported) in the device description:

$ flutter run -d 1754b457ae0324670be2493c147bf08bdad86907
No supported devices found with name or id matching '1754b457ae0324670be2493c147bf08bdad86907'.

The following devices were found:
iPhone 4s (mobile)        • 1754b457ae0324670be2493c147bf08bdad86907 • ios            • iOS 9.3.6 13G37 (unsupported)
Chrome (web)              • chrome                                   • web-javascript • Google Chrome 97.0.4692.99

Context: #66696 conflated isSupported with isSupportedForProject. flutter logs -d device should work even when outside of a flutter project. However, unsupported devices (for all projects) should never be allowed to be targeted.

For example, the Chrome device is "unsupported" when the Chrome isn't installed, but it's "supported" and "not supported for project" when the web directory is missing from a project.

Fixes #97331

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 27, 2022
@jmagman jmagman self-assigned this Jan 27, 2022
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ optional test naming suggestions

Co-authored-by: Zachary Anderson <[email protected]>
@jmagman jmagman merged commit a599c23 into flutter:master Feb 2, 2022
@jmagman jmagman deleted the unsupported-devices branch February 2, 2022 00:13
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Feb 4, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter run -d <unsupported device> tries to run on the unsupported device

2 participants