Skip to content

Conversation

@ireinhart
Copy link
Contributor

Description

to be more clear in usage use the common device/emulator list.
We can see more detailed information to chose the device name oder device id at flutter -d

Related Issues

fix #37395

to be more clear in usage use the common device/emulator list.
We can see more detailed information to chose the device name oder device id at flutter -d

fix #37395
@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 12, 2019
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ireinhart
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@jmagman
Copy link
Member

jmagman commented Aug 12, 2019

@ireinhart Can we get the output of what this looks like before and after your change?

@jonahwilliams I think you were recently around this code with 6830edd.

@jonahwilliams jonahwilliams self-requested a review August 12, 2019 18:20
@jonahwilliams
Copy link
Contributor

@ireinhart please take a look at the failing tests when you get the chance

@jmagman
Copy link
Member

jmagman commented Aug 12, 2019

The drive command tests are failing with this change.
https://cirrus-ci.com/task/4566388641890304?command=test_all#L1843

You can run this locally:

$ cd packages/flutter_tools 
$ pub run test test/general.shard/commands/drive_test.dart

@jmagman jmagman added the t: flutter driver "flutter driver", flutter_drive, or a driver test label Aug 12, 2019
@ireinhart
Copy link
Contributor Author

@jmagman Yes, I see the failing tests and working on it. With 6830edd a test was added, that seams to need much more mocking.

If you run the command 'flutter dirve --target=...' and you have more than one device/emulator running the output looks like:

$ flutter  drive --target=test_driver/app.dart
Found multiple connected devices:
  - SM G950F
  - Android SDK built for x86
  - Android SDK built for x86
  - iPhone Xʀ
  - macOS
  - web

Using device SM G950F.
Starting application: test_driver/app.dart
...

After the patch it looks like (similar to 'flutter devices'):

$ flutter  drive --target=test_driver/app.dart
Found multiple connected devices:
SM G950F                  • 9889d6375a35414f50                   • android-arm64  • Android 9 (API 28)
Android SDK built for x86 • emulator-5554                        • android-x86    • Android 9 (API 28) (emulator)
Android SDK built for x86 • emulator-5556                        • android-x86    • Android 9 (API 28) (emulator)
iPhone Xʀ                 • E8118673-BDCE-4D52-AEC4-FCB85FE1B452 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
macOS                     • macOS                                • darwin-x64     • Mac OS X 10.14.6 18G87
web                       • web                                  • web-javascript • Google Chrome 76.0.3809.100

Using device SM G950F.
Starting application: test_driver/app.dart
...
$ flutter devices
6 connected devices:

SM G950F                  • 9889d6375a35414f50                   • android-arm64  • Android 9 (API 28)
Android SDK built for x86 • emulator-5554                        • android-x86    • Android 9 (API 28) (emulator)
Android SDK built for x86 • emulator-5556                        • android-x86    • Android 9 (API 28) (emulator)
iPhone Xʀ                 • E8118673-BDCE-4D52-AEC4-FCB85FE1B452 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
macOS                     • macOS                                • darwin-x64     • Mac OS X 10.14.6 18G87
web                       • web                                  • web-javascript • Google Chrome 76.0.3809.100

I like the new (long) output to be more clear that you can choose the both first fields from the table at the -d option for flutter. The sort list is not so helpful, if you work with more than one android emulator.

@ireinhart
Copy link
Contributor Author

@jonahwilliams could you take a look? I hop it is ok for you.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@pripriya2
Copy link

pripriya2 commented Jul 8, 2020

Hi , what is the command i would provide to make it run the test on a particular device:
I am still not able to run a test on a device with device-id:
Environment:
Flutter 1.20.0-3.0.pre • channel master • https://github.com/flutter/flutter.git
Framework • revision c68758f (13 days ago) • 2020-06-24 21:23:02 -0700
Engine • revision 0c14126
Tools • Dart 2.9.0 (build 2.9.0-18.0.dev d8eb844e5d)

Please see the below error highlighted:
flutter drive --target=test_driver/app.dart --driver=test_driver/gherkin_test.dart -d 277b2a392e1c7ece
Starting application: test_driver/app.dart
Installing build/app/outputs/flutter-apk/app.apk... 10.1s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 6.6s
✓ Built build/app/outputs/flutter-apk/app-debug.apk.
Installing build/app/outputs/flutter-apk/app.apk... 7.6s
I/flutter (12882): Observatory listening on http://127.0.0.1:40279/2qVXaBgcpLA=/
Found feature file './test_driver/features/signup.feature'
Parsing feature file: './test_driver/features/signup.feature'
Found 1 feature file(s) to run
Executing features in random order
Starting Flutter app under test 'test_driver/app.dart', this might take a few moments
More than one device connected; please specify a device with the '-d ' flag, or use '-d all' to act on all devices.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

t: flutter driver "flutter driver", flutter_drive, or a driver test 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 drive device identifier

6 participants