maestro
maestro copied to clipboard
Better output on device connection issues
Proposal for Maestro output on device connection issues:
Running device(s) detected
If there is only one device running, run on that one. Otherwise, prompt the user to select from a list of running devices.
Single Running Device
$ maestro test Flow.yaml
# Runs on the single running device
Multiple Running Devices
Note: Android device discovery should use the adb server to detect running devices to support both emulator and physical device discovery.
$ maestro test Flow.yaml
Android
[1] emulator-5554
[2] 1B091FDF6007M9
iOS
[3] iPhone 8 - iOS 15.5 - D1896F78-24CE-45B4-BB37-0EF5CB70D878
[4] iPhone 8 Plus - iOS 15.5 - 7B916FC2-1BDF-4530-8CA3-96C80C83307E)
[5] iPhone 11 - iOS 15.5 - 1F0FEE74-86E3-403A-8909-CF14F63F003E
Multiple running devices detected. Choose a device to run on.
Enter a number from the list above:
No Running Devices
Detect available simulators / emulators to boot and prompt the user to launch one from a list. If none are available, print instructions to set up environment.
Simulators/Emulators are available to launch
$ maestro test Flow.yaml
Android
[1] Pixel_2_API_24 - Android 7.0
[2] Pixel_4_API_30 - Android 11.0 - Google Play
iOS
[3] iPhone 8 - iOS 15.5 - D1896F78-24CE-45B4-BB37-0EF5CB70D878
[4] iPhone 8 Plus - iOS 15.5 - 7B916FC2-1BDF-4530-8CA3-96C80C83307E)
[5] iPhone 11 - iOS 15.5 - 1F0FEE74-86E3-403A-8909-CF14F63F003E
[6] iPhone 11 Pro - iOS 15.5 - 5453FF51-DCCE-4582-A79E-5F4585AB6C50
[7] iPhone 11 Pro Max - iOS 15.5 - 4A4BB058-96A0-40D4-B8AB-0F1B564341FE
[8] iPhone 12 mini - iOS 15.5 - 9E10521D-D43C-4A66-BA12-1703B6579F03
[9] iPhone 12 - iOS 15.5 - B594BF2E-CF33-4748-A629-50977BD6AAA2
[10] iPhone 12 Pro - iOS 15.5 - 473E63BB-F284-4F48-8B7A-DC647527D351
[11] iPhone 12 Pro Max - iOS 15.5 - AF15981E-2FAA-4403-9D88-563D5B35D72F
[12] iPhone 13 Pro - iOS 15.5 - FEF5331A-E028-40D0-A419-9664907AC4D8
[13] iPhone 13 Pro Max - iOS 15.5 - 1A0A2307-D7E6-4EA3-A7BC-AB5837965CFD
[14] iPhone 13 mini - iOS 15.5 - B6B13EAA-711B-4DD7-BAAA-A5B35FEBA398
[15] iPhone 13 - iOS 15.5 - 5823632A-F73C-4C8A-A402-1ACD2174FC02
[16] Test - iOS 15.5 - 79856E2A-91E4-41DB-B7A3-A3C1FEB893B5
[17] iPhone SE - iOS 15.5 - 3rd generation) (BC0BD29E-732E-40A5-8CCB-B21DD961F194
[18] iPod touch (7th generation) - iOS 15.5 - DD5F9A55-074A-4035-81CC-30E82F9F88CD
[19] iPad Pro (9.7-inch) - iOS 15.5 - 54738849-6C72-4B2A-8E27-8F787F90DEDD
[21] iPad (9th generation) - iOS 15.5 - 5A8403F6-D4AF-4187-8327-1BE340686755
[22] iPad Pro (11-inch) (3rd generation) - iOS 15.5 - 23044113-C6D7-4863-B5BF-57C69F569FFD
[23] iPad Pro (12.9-inch) (5th generation) - iOS 15.5 - 15B4E055-B28E-4A47-9934-8068DB85FFA7
[24] iPad Air (5th generation) - iOS 15.5 - FDF2DA46-CC4E-4982-A7D1-B687F2B0452D
[25] iPad mini (6th generation) - iOS 15.5 - 90B6EF7F-76AB-4FF1-A046-A3AD5AAFC5EB
[26] Apple TV - iOS 15.5 - 990506C0-1810-49A0-8B4F-5A37E18CAAAA
[27] Apple TV 4K (2nd generation) - iOS 15.5 - C2009C8F-622C-4AA1-8902-56664C85E414
[27] Apple TV 4K (at 1080p) (2nd generation) - iOS 15.5 - 5CB6C888-ABA1-4D2F-ABCE-3BB45B81A7FA
[28] Apple Watch Series 5 - 40mm - iOS 15.5 - 101AF578-4894-494F-8554-A9A6182E9C87
[29] Apple Watch Series 5 - 44mm - iOS 15.5 - 0BD7377C-5875-435B-8882-BB084D49BF90
[30] Apple Watch Series 6 - 40mm - iOS 15.5 - 68F4149B-0580-42EF-8994-70AC31E0B2CA
[31] Apple Watch Series 6 - 44mm - iOS 15.5 - 5287B6B0-F346-4929-8F08-D2F24DEA2C11
[32] Apple Watch Series 7 - 41mm - iOS 15.5 - E6F763AC-04B7-4D3F-884E-5FD679253757
[33] Apple Watch Series 7 - 45mm - iOS 15.5 - 4EFEB3FF-1EBA-4F98-BFEA-9FE68273F05B
No running devices detected. Choose a device to boot and run on.
Enter a number from the list above:
No Simulators/Emulators available to launch
If we can't find any devices to launch, print instructions on how to set up an iOS Simulator, Android Emulator, or Physical Device (Android-only).
$ maestro test Flow.yaml
No devices detected. Check out the instructions below to set up a device.
* Setup an iOS Simulator: https://maestro.mobile.dev/path-to-instructions
* Setup an Android Emulator: https://maestro.mobile.dev/path-to-instructions
* Connect a Physical Device: https://maestro.mobile.dev/path-to-instructions
Note that this makes the most sense once Maestro is handling idb_companion internally. It's possible to implement the above (or part of it) before Maestro handles idb_companion internally, but the messaging will be more confusing.
On this piece:
Note: Android device discovery should use the adb server to detect running devices to support both emulator and physical device discovery.
dadb 1.2.2 introduces the Dadb.list() api which can be used to list out available emulators and physical devices. Use the Dadb.toString() method to get the names of the devices.
This has been implemented! 🙌
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue. Thank you for helping keep us our issue tracker clean!