Git Product home page Git Product logo

screenshots's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

screenshots's Issues

Flutter Daemon is not starting

Hi, I am getting stuck on running the plugin at the point where the flutter daemon is supposed to be starting.

Starting flutter daemon...
Unhandled exception:
ProcessException: No such file or directory
  Command: flutter daemon
#0      DaemonClient.start (package:screenshots/src/daemon_client.dart:32:18)
<asynchronous suspension>
#1      run (package:screenshots/src/run.dart:33:22)
<asynchronous suspension>
#2      main (file:///Users/jonas.hoefer/.pub-cache/hosted/pub.dartlang.org/screenshots-1.2.0/bin/main.dart:82:9)
<asynchronous suspension>
#3      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

Here is my flutter doctor -v:

[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.4 18E226, locale de-DE)
    • Flutter version 1.7.8+hotfix.3 at /Users/jonas.hoefer/Dev/flutter
    • Framework revision b712a172f9 (8 days ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/jonas.hoefer/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_SDK_ROOT = /Users/jonas.hoefer/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.6.1

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 37.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.1.1 (API 25) (emulator)

• No issues found!

Any suggestions how to solve this?
Thank you

iOS Simulator screenshot - invalid device error

Hi Maurice, I am having some issues getting this to run on iOS Simulator

steps to reproduce:

  1. target iPhone 7 Plus in screenshots.yaml
  2. launch iOS simulator and with iPhone 7 Plus device opened
  3. setup basic driver test with await screenshot(driver, config, 'SplashScreen');
  4. run screenshots

currently getting the following error:

❯ screenshots
Clearing images in ios/fastlane/screenshots/en-AU for 'iPhone 7 Plus'...
Starting simulator 'iPhone 7 Plus' in locale en-AU ...
Invalid device: E96E4A16-72F8-4841-BF60-381F0BB424B0) (Shutdown
Unhandled exception:
command failed: cmd='xcrun simctl boot E96E4A16-72F8-4841-BF60-381F0BB424B0) (Shutdown'
#0      cmd (package:screenshots/utils.dart:36:5)
#1      simulator (package:screenshots/screenshots.dart:202:5)
#2      run (package:screenshots/screenshots.dart:66:9)
<asynchronous suspension>
#3      main (file:///Users/zanuka/.pub-cache/hosted/pub.dartlang.org/screenshots-0.1.4/bin/main.dart:63:9)
<asynchronous suspension>
#4      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

the same driver test is capturing screenshot fine on Android emulators and placing files in the right directory - android/fastlane/metadata/android/en-AU/

Specify frame at platform/device level

When generating screenshots, I have found I want frames enabled for Android and disabled for iOS. This is a little annoying because now I have to switch my config around every time I run (or have a separate config for each platform).

It would be nice if the frame configuration parameter was hoisted so that I could specify it per platform, or even override it per device:

tests:
  - test_driver/app.dart

staging: /tmp/screenshots

locales:
  - en-AU

devices:
  ios:
    - iPhone 7 Plus
      frame: false
    - iPad Pro (12.9-inch) (2nd generation)
      frame: false
  android:
    - Nexus 9
      frame: true
    - Nexus 6P
      frame: true

Flavor support

First of all, thanks for this great tool!

Can we add flavor support? For example:
screenshots --flavor [flavorname]

Codemagic: Screenshots expects no devices to be running at startup

Hi,

I'm trying to use screenshots in conjunction with Codemagic CI. However, I'm getting this error:

# Screenshots expects no devices to be running at startup. 
# Please disconnect all devices and shutdown all simulators/emulators.

The message does not tell me what simulators/emulators it found to be running, so I'm not sure whether it's Android, iOS, or both.

Do I have any recourse here, considering I have no control over Codemagic's infrastructure? Is there anything I could ask the Codemagic team in order to get past this problem?

Problem with android emulator - stuck at 'Starting emulator'

Error: Screenshot command stays at starting emulator. Emulator is starting on a new window. It does not recognize that the emulator started.

Android sdk:

Yannik@workaholic:tiny_release $ emulator -list-avds
Nexus_10_API_27
Nexus_5X
Nexus_6P

Yannik@workaholic:tiny_release $ echo ${ANDROID_SDK_ROOT}
/usr/local/share/android-sdk

Flutter-Doc:

Yannik@workaholic:tiny_release $ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
[!] Android Studio (version 3.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Ultimate Edition (version 2018.3.5)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

Screenshot command:

Yannik@workaholic:tiny_release $ screenshots
Warning: Flutter integration tests do not work in multiple locals.
  See issue: https://github.com/flutter/flutter/issues/27785 for details.
  and provide a thumbs-up to prioritize a fix for this issue!

  While waiting for a fix configure only the default locale
  in screenshots.yamlClearing images in ios/fastlane/screenshots/en-GB for 'iPhone X'...
Clearing images in ios/fastlane/screenshots/de-DE for 'iPhone X'...
Clearing images in ios/fastlane/screenshots/en-GB for 'iPad Pro (12.9-inch) (2nd generation)'...
Clearing images in ios/fastlane/screenshots/de-DE for 'iPad Pro (12.9-inch) (2nd generation)'...
Clearing images in android/fastlane/metadata/android/en-GB/images/phoneScreenshots for 'Nexus 6P'...
Clearing images in android/fastlane/metadata/android/de-DE/images/phoneScreenshots for 'Nexus 6P'...
Starting emulator 'Nexus_6P' in locale en-GB ...

Stuck after starting Android emulator in locale en-US

I'm seeing this issue as well with Android emulators (iOS simulators work fine), and am using only en-US:

screenshots.yaml:

...
locales:
#  - fr-CA
  - en-US # this is assumed to be the default for your test machine.
...
devices:
  ios:
    - iPhone X
    - iPad Pro (12.9-inch) (2nd generation)
  android:
    - Nexus 6P
...

Issue exists for both Nexus 5X and 6P.

$ emulator -list-avds
Nexus_5X_API_27
Nexus_6P_API_28

Originally posted by @noumaans in #19 (comment)

Changing locale is not possible if there is only one

If you change a single locale in the screenshots.yaml it will not be changed in the simulator/emulator because isMultipleLocales will be false.

Can't we just remove the isMultipleLocales argument of both the simulator and emulator methods and set the locale every time?

Run one device OS only

Currently, the I working on only creating/shipping an iOS app (I just don't have the resources to focus on both at the time). It would be very useful if you could specify in the config to only run tests on one OS type or the other without having to have the development environment installed for the other.

Support iPhone XS Max and 12.9-inch iPad Pro (3rd generation)

From the Apple Developer 'submitting iOS apps article',

Starting March 27, 2019, all app submissions for iPhone or iPad, including universal apps, will require screenshots for iPhone XS Max or the 12.9-inch iPad Pro (3rd generation).

We ended up taking manual screenshots in Xcode to submit our latest update, however it would be excellent to update/create configs so that screenshots can be leveraged in fastlane, travis or other pipeline configs.

@mmcc007 I've added notes about this to my previously closed PR #15, which I'm now working on again, but that PR should just focus on the frame color options and the new configs could be handled in separate PR's or whatever you see fit. Happy to help.

Running tests on azure pipelines

Azure has all desktop OS's with identical script driving them.
It natively runs in UI mode, so screenshots and Integration Test work.

It's much faster than Travis
It's free for open Github and Bitbucket.

If anyone interested as I will be using this.
Maybe this should be part of the Fledge project instead ?

Localization not working

Relates to flutter/flutter#27785
Bump this for fixing.

I noticed that on some runs the localizations worked for me with ios simulator. Tested it with de_DE and en_GB.

German screenshots were located in the gb dir, the english ones in the german dir. Not reproducible.

Is there any way to workaround this issue? E.g. restart emulator with proper locale to override flutter driver.

Error: no device attached or simulator installed for device

after Xcode-beta(11) and return to Xcode(10):
run screenshots

Starting flutter daemon...
Error: no device attached or simulator installed for device 'iPhone XS Max' in screenshots.yaml.

Guide:
  Attached devices:
Unhandled exception:
ProcessException: No such file or directory
  Command: emulator -list-avds
#0      _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:489:7)
#1      _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:634:18)
#2      Process.runSync (dart:io-patch/process_patch.dart:66:12)
#3      cmd (package:screenshots/src/run.dart:375:26)
#4      getAvdNames (package:screenshots/src/utils.dart:159:10)
#5      Config.generateConfigGuide (package:screenshots/src/config.dart:164:31)
#6      Config.validate (package:screenshots/src/config.dart:104:11)
<asynchronous suspension>
#7      run (package:screenshots/src/run.dart:40:16)
<asynchronous suspension>
#8      main (file:///Users/gorniv/github/screenshots/bin/main.dart:79:9)
<asynchronous suspension>
#9      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
xcrun simctl list devices --json
{
  "devices" : {
    "com.apple.CoreSimulator.SimRuntime.iOS-12-0" : [

    ],
    "com.apple.CoreSimulator.SimRuntime.tvOS-12-2" : [

    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-12-2" : [
      {
        "state" : "Shutdown",
        "isAvailable" : true,
        "name" : "iPhone Xs Max",
        "udid" : "3AD11D72-B3FA-4E4C-94B3-E4E51C67250A"
      }
    ],
    "com.apple.CoreSimulator.SimRuntime.watchOS-5-2" : [

    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-9-3" : [

    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-12-1" : [

    ],
    "com.apple.CoreSimulator.SimRuntime.iOS-9-0" : [

    ]
  }
}
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F203, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.36.1)
[!] Connected device
    ! No devices available
# A list of screen capture tests
tests:
  - test_driver/main_store.dart

# Interim location of screenshots from tests
staging: /tmp/screenshots

# A list of locales supported by the app
locales:
  - en-US

# A map of devices to emulate
devices:
  ios:
    iPhone Xs Max:
  # android:
  #   Nexus 6P:

# Frame screenshots
frame: true
emulator -list-avds
Nexus_6P_API_29
Pixel_API_24

Remove restriction on requiring no running emulators

Currently screenshots requires that no emulators are running at startup. This is a simplifying restriction used to reduce amount of code during development. This restriction can probably be lifted by adding code to by-pass emulator startup if emulator is already running.

Test not found - _test suffix added somewhere

My test is present at test_driver/app_full_test.dart

screenshots.yaml

# Screen capture tests
tests:
  - test_driver/app_full_test.dart

# Interim location of screenshots from tests
staging: /tmp/screenshots

# A list of locales supported by the app
locales:
  - de-DE
  - en-US

# A list of devices to emulate
devices:
  ios:
    - iPhone X
    #    - iPhone 7 Plus
    - iPad Pro (12.9-inch) (2nd generation)
  #   "iPhone 6",
  #   "iPhone 6 Plus",
  #   "iPhone 5",
  #   "iPhone 4s",
  #   "iPad Retina",
  #   "iPad Pro"
  android:
#    - Nexus 6P
#    - Nexus 5X

# Frame screenshots
frame: true

Yannik@workaholic:tiny_release $ screenshots
Warning: Flutter integration tests do not work in multiple locals.
  See issue: https://github.com/flutter/flutter/issues/27785 for details.
  and provide a thumbs-up to prioritize a fix for this issue!

  While waiting for a fix configure only the default locale
  in screenshots.yamlClearing images in ios/fastlane/screenshots/de-DE for 'iPhone X'...
Clearing images in ios/fastlane/screenshots/en-US for 'iPhone X'...
Clearing images in ios/fastlane/screenshots/de-DE for 'iPad Pro (12.9-inch) (2nd generation)'...
Clearing images in ios/fastlane/screenshots/en-US for 'iPad Pro (12.9-inch) (2nd generation)'...
Starting simulator 'iPhone X' in locale de-DE ...
Capturing screenshots with test test_driver/app_full_test.dart on simulator iPhone X in locale de-DE ...
Using device iPhone X.
Test file not found: /Users/Yannik/work/tiny_release/test_driver/app_full_test_test.dart
Unhandled exception:
command failed: cmd='flutter drive test_driver/app_full_test.dart'
#0      streamCmd (package:screenshots/utils.dart:66:7)
<asynchronous suspension>
#1      screenshots (package:screenshots/screenshots.dart:101:9)
<asynchronous suspension>
#2      run (package:screenshots/screenshots.dart:71:17)
#3      _RootZone.runUnary (dart:async/zone.dart:1379:54)
#4      _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#5      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#6      Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#7      Future._complete (dart:async/future_impl.dart:473:7)
#8      _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#9      _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#10     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:294:13)
#11     clearFastlaneDirs (package:screenshots/fastlane.dart)
#12     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#15     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#16     Future._complete (dart:async/future_impl.dart:473:7)
#17     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#18     _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28:18)
#19     _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:294:13)
#20     clearFastlaneDir (package:screenshots/fastlane.dart)
#21     _RootZone.runUnary (dart:async/zone.dart:1379:54)
#22     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#23     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#24     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#25     Future._addListener.<anonymous closure> (dart:async/future_impl.dart:348:9)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)


Frame not generated with the screenshot

ImageMagick is available on my MAC.

I have added screenshots to my integration test (test_driver directory)

launch the test:
flutter drive --target=test_driver/my_app.dart

The screenshot is available in the /tmp/screenshots directory

BUT
No frame of the screenshot with iOS device
The directory /tmp/ios is empty (should have framed images here)

config file:

# Screen capture tests
tests:
- test_driver/my_app.dart

# Interim location of screenshots from tests before processing
staging: /tmp/screenshots

# A list of locales supported in app
locales:
- en-US
#  - de-DE

# A list of devices to emulate
devices:
  ios:
  - iPhone X
  - iPhone 7 Plus
  #- iPad Pro (12.9-inch) (2nd generation)
  #   "iPhone 6",
  #   "iPhone 6 Plus",
  #   "iPhone 5",
  #   "iPhone 4s",
  #   "iPad Retina",
  #   "iPad Pro"
  android:
  #- Nexus 5X

# Frame screenshots
frame: true

## final destination of processed screenshots
dest:
  ios: /tmp/ios
  android: /tmp/android

No tablet configuration for Android?

I've just tried adding different devices to my screenshots.yaml and quickly found that I can't add arbitrary emulator names, but instead they have to be present in screens.yaml (makes sense, in retrospect). The thing is, screens.yaml has a very limited range of Android screen sizes (only two, both of which are phones). I would like to include tablet size screenshots in my app store submission (e.g. Nexus 10) but that doesn't seem supported yet? Should it be? I may well be missing something here.

iOS: Google Maps views are not captured

Hello Maurice,

First, thank you for all your work in your Flutter packages!

I’m a dev too and using your screenshots package saved my day… my week rather ;-) (Had to generate 300 screenshots / per platform…)

Everything works fine, except in this case:

My app use google maps view
https://pub.dev/packages/google_maps_flutter

and the map is not being captured in the screenshot = it’s empty
It happens only on iOS.

Made with screenshots package
iPhone 8 Plus-screenshot_5_maps

Made manually
Simulator Screen Shot - iPhone Xs Max - 2019-08-13 at 11 51 51

Thanks!

running `screenshots` with Simulator app closed

was able to reproduce on iMac and MacBook Air, both running XCode 10.1, MacOS 10.14.3

I could run screenshots just fine w/ the following config:

devices:
  ios:
    - iPhone X
    - iPhone 7 Plus
    - iPad Pro (12.9-inch) (2nd generation)

but only with the Simulator app opened, and all devices closed.

if I try to run with the Simulator app closed, I get driver test failures that look like this:

00:22 +11 -1: smoke test DashboardScreen > take screenshot [E]
  DriverError: Error in Flutter application: Timeout while executing waitUntilNoTransientCallbacks: TimeoutException after 0:00:05.000000: Future not completed
  #0      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:180:31)
  <asynchronous suspension>
  #1      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:438:32)
  <asynchronous suspension>
  #2      _runExtension (dart:developer/runtime/libdeveloper.dart:86:23)

  Original error: null
  Original stack trace:
  null

  package:flutter_driver/src/driver/driver.dart 440:7   FlutterDriver._sendCommand
  ===== asynchronous gap ===========================
  dart:async/future_impl.dart 22:43                     _Completer.completeError
  dart:async/runtime/libasync_patch.dart 40:18          _AsyncAwaitCompleter.completeError
  package:flutter_driver/src/driver/driver.dart         FlutterDriver._sendCommand
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                          _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23          _asyncThenWrapperHelper
  package:flutter_driver/src/driver/driver.dart         FlutterDriver._sendCommand
  package:flutter_driver/src/driver/driver.dart 490:11  FlutterDriver.waitUntilNoTransientCallbacks
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1053:19                          _CustomZone.registerUnaryCallback
  dart:async/runtime/libasync_patch.dart 77:23          _asyncThenWrapperHelper
  package:test_api/src/backend/declarer.dart            Declarer.test.<fn>.<fn>.<fn>
  package:test_api/src/backend/invoker.dart 249:15      Invoker.waitForOutstandingCallbacks.<fn>
  ===== asynchronous gap ===========================
  dart:async/zone.dart 1045:19                          _CustomZone.registerCallback
  dart:async/zone.dart 962:22                           _CustomZone.bindCallbackGuarded
  dart:async/timer.dart 52:45                           new Timer
  dart:async/timer.dart 87:9                            Timer.run
  dart:async/future.dart 174:11                         new Future
  package:test_api/src/backend/invoker.dart 398:11      Invoker._onRun.<fn>.<fn>.<fn>

running flutter driver --target=test_driver/smoke.dart from CLI

generates No devices found. which I had expected if the Simulator app is closed.

When a test fails, simulator still running

Anyway to get screenshots to clean up after itself if an error occurs in the testing. (e.g. a widget not found or too many widgets found)?

The workaround now (for IOS) is to open the simulator and then quit it.

command failed: cmd='adb emu kill'

On my Linux PC, nexus 6 screenshot for 1 language is OK.

When I try to use another localization, when I starts the screenshots command I receive this error:
command failed: cmd='adb emu kill'
after the first language ends its work.

Here the full log:

`alessandroid@TUXEDO:~/Developer/PFP/testFlutter/flutter_app$ /home/alessandroid/.pub-cache/bin/screenshots
Warning: 'Nexus 6P' does not have a matching emulator.
: Using 'Nexus_6P_API_Q'.
Warning: Flutter integration tests do not work in multiple locals.
See comment on issue:
flutter/flutter#27785 (comment)
for details.
and provide a thumbs-up on the comment to prioritize a fix for this issue!

In the meantime, while waiting for a fix, only use the default locale
in screenshots.yaml

Clearing images in android/fastlane/metadata/android/it-IT/images/phoneScreenshots for 'Nexus 6P'...
Clearing images in android/fastlane/metadata/android/es-ES/images/phoneScreenshots for 'Nexus 6P'...
Clearing images in android/fastlane/metadata/android/en-US/images/phoneScreenshots for 'Nexus 6P'...
Starting emulator 'Nexus 6P' in locale it-IT ...
Emulator is ready
Capturing screenshots with test app test_driver/app.dart on emulator 'Nexus 6P' in locale it-IT ...
Using device Android SDK built for x86.
Starting application: test_driver/app.dart
Initializing gradle... 2,1s
Resolving dependencies... 4,1s
Installing build/app/outputs/apk/app.apk... 5,8s
Running Gradle task 'assembleDebug'... 10,1s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk... 2,0s
I/flutter ( 9623): Observatory listening on http://127.0.0.1:33407/cu3jrGHxfII=/
00:00 +0: Counter App (setUpAll)
00:02 +0: Counter App starts at 0
Screenshot myscreenshot1 created
00:04 +1: Counter App increments the counter
Screenshot myscreenshot2 created
00:07 +2: Counter App (tearDownAll)
00:07 +2: All tests passed!
Stopping application instance.
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:35367/cu3jrGHxfII=/
[trace] FlutterDriver: Isolate found with number: 540638223
[trace] FlutterDriver: Isolate is paused at start.
[trace] FlutterDriver: Attempting to resume isolate
[trace] FlutterDriver: Waiting for service extension
[info ] FlutterDriver: Connected to Flutter application.
Processing screenshots from test...
Moving screenshots to android/fastlane/metadata/android/it-IT/images/phoneScreenshots
Stopping emulator: 'Nexus 6P' ...
Emulator is stopped
Starting emulator 'Nexus 6P' in locale es-ES ...
Emulator is ready
Capturing screenshots with test app test_driver/app.dart on emulator 'Nexus 6P' in locale es-ES ...
Using device Android SDK built for x86.
Starting application: test_driver/app.dart
Initializing gradle... 2,1s
Resolving dependencies... 4,6s
Installing build/app/outputs/apk/app.apk... 7,9s
Running Gradle task 'assembleDebug'... 2,3s
Built build/app/outputs/apk/debug/app-debug.apk.
I/flutter (12254): Observatory listening on http://127.0.0.1:44971/fDX1UM8YUb0=/
00:00 +0: Counter App (setUpAll)
00:02 +0: Counter App starts at 0
Screenshot myscreenshot1 created
00:04 +1: Counter App increments the counter
Screenshot myscreenshot2 created
00:07 +2: Counter App (tearDownAll)
00:07 +2: All tests passed!
Stopping application instance.
[info ] FlutterDriver: Connecting to Flutter application at http://127.0.0.1:38161/fDX1UM8YUb0=/
[trace] FlutterDriver: Isolate found with number: 1027751757
[trace] FlutterDriver: Isolate is paused at start.
[trace] FlutterDriver: Attempting to resume isolate
[trace] FlutterDriver: Waiting for service extension
[info ] FlutterDriver: Connected to Flutter application.
Processing screenshots from test...
Moving screenshots to android/fastlane/metadata/android/es-ES/images/phoneScreenshots
Stopping emulator: 'Nexus 6P' ...
adb server version (41) doesn't match this client (39); killing...
ADB server didn't ACK
Full server startup log: /tmp/adb.1000.log
Server had pid: 21431
--- adb starting (pid 21431) ---
adb I 05-18 18:24:13 21431 21431 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 05-18 18:24:13 21431 21431 main.cpp:57] Version 1:8.1.0+r23-5~18.04
adb I 05-18 18:24:13 21431 21431 main.cpp:57] Installed as /usr/lib/android-sdk/platform-tools/adb
adb I 05-18 18:24:13 21431 21431 main.cpp:57]
adb I 05-18 18:24:13 21431 21431 adb_auth_host.cpp:416] adb_auth_init...
adb I 05-18 18:24:13 21431 21431 adb_auth_host.cpp:174] read_key_file '/home/alessandroid/.android/adbkey'...
adb I 05-18 18:24:13 21431 21431 adb_auth_host.cpp:391] adb_auth_inotify_init...
adb server killed by remote request
--- adb starting (pid 21438) ---
adb I 05-18 18:24:13 21438 21438 main.cpp:60] Android Debug Bridge version 1.0.41
adb I 05-18 18:24:13 21438 21438 main.cpp:60] Version 28.0.3-5475833
adb I 05-18 18:24:13 21438 21438 main.cpp:60] Installed as /home/alessandroid/Android/Sdk/platform-tools/adb
adb I 05-18 18:24:13 21438 21438 main.cpp:60]
adb I 05-18 18:24:13 21438 21438 auth.cpp:405] adb_auth_init...
adb I 05-18 18:24:13 21438 21438 auth.cpp:380] adb_auth_inotify_init...
adb I 05-18 18:24:13 21438 21445 transport.cpp:281] emulator-5554: read thread spawning
adb I 05-18 18:24:13 21438 21446 transport.cpp:294] emulator-5554: write thread spawning
adb I 05-18 18:24:13 21438 21438 adb.cpp:110] emulator-5554: already offline

  • failed to start daemon
    error: no emulator connected: cannot connect to daemon
    Unhandled exception:
    command failed: cmd='adb emu kill'
    #0 cmd (package:screenshots/utils.dart:38:5)
    #1 emulator (package:screenshots/screenshots.dart:169:5)
#2 run (package:screenshots/screenshots.dart:58:15) #3 main (file:///home/alessandroid/.pub-cache/hosted/pub.dartlang.org/screenshots-0.1.7/bin/main.dart:93:9) #4 _startIsolate. (dart:isolate-patch/isolate_patch.dart:298:32) #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12) `

Support output directory configuration

Currently this library assumes it is being used for fastlane. Therefore, it stores all screenshots in a fastlane directory within each app project.

I'd like to specify an output directory for all screenshots in the screenshots.yaml configuration file. My use-case is unrelated to CI.

adb not found

I try to run screenshots and receive this message:

#############################################################
# 'adb' must be in the PATH to use Screenshots
# You can usually add it to the PATH using
# export PATH='~/Library/Android/sdk/platform-tools:$PATH'  
#############################################################

My .bash_profile:

export PATH="$PATH:~/Library/Android/sdk/platform-tools"
export PATH="$PATH:~/Documents/flutter/bin"
export PATH="$PATH:~/Documents/flutter/bin/cache/dart-sdk/bin"
export PATH="$PATH:~/.pub-cache/bin"

When I use ADB in the terminal everything works fine but if I try to run which adb, the result is empty.

Flutter Doctor:

[✓] Flutter (Channel beta, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale
    pt-BR)
    • Flutter version 1.7.8+hotfix.3 at /Users/edufolly/Documents/flutter
    • Framework revision b712a172f9 (5 days ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /Users/edufolly/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.7.4

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 37.0.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.36.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.2.0

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API
      28) (emulator)

• No issues found!

Thanks for the amazing plugin.

Landscape mode

Especially on tablets most app layouts tend to be different in landscape mode. It would be nice to show this in some screenshots.

Changing locale on android emulator: `failed to clear the 'main' log`

Hi I'd really appreciate some help with this issue since it's kind of deal breaker here and cost me quite some time...

I have everything set accordingly to the README. When running the screenshots command in terminal with only an ios device active in the screenshots.yaml everything works fine in terms of loading the different localizations and creating the screenshots. But when I run it on an Android Emulator (here: Nexus 6P) and the device locale is not the only entered locale under locales: in screenshots.yaml the following is the result:

Changing locale from en-US to de_DE on 'Nexus 5X'...
failed to clear the 'main' log
Unhandled exception:
command failed: exitcode=1, cmd='adb -s emulator-5556 logcat -c', workingDir=., silent=false
#0      cmd (package:screenshots/src/run.dart:535:5)
#1      waitSysLogMsg (package:screenshots/src/utils.dart:292:3)
<asynchronous suspension>
#2      waitAndroidLocaleChange (package:screenshots/src/utils.dart:246:13)
<asynchronous suspension>
#3      setEmulatorLocale (package:screenshots/src/run.dart:429:11)
<asynchronous suspension>
#4      runTestsOnAll (package:screenshots/src/run.dart:219:17)
<asynchronous suspension>
#5      run (package:screenshots/src/run.dart:64:9)
<asynchronous suspension>
#6      main (file:///Users/tomebert/.pub-cache/hosted/pub.dartlang.org/screenshots-1.3.0/bin/main.dart:85:9)
<asynchronous suspension>
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

My screenshots.yaml looks like following:

# A list of screen capture tests
# Note: flutter driver expects a pair of files eg, main1.dart and main1_test.dart
tests:
  - test_driver/app.dart

# Interim location of screenshots from tests
staging: /tmp/screenshots

# A list of locales supported by the app
locales:
  - en-US
  - de_DE

# A map of devices to emulate
devices:
  ios:
#    iPhone X:
#      frame: true
#    iPad Pro (12.9-inch) (3rd generation):
#      orientation: LandscapeRight
  android:
    Nexus 6P:

# Frame screenshots
frame: true

And output of flutter doctor is:

[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale en-DE)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1)
[✓] VS Code (version 1.35.1)
[✓] Connected device (2 available)

• No issues found!

Please let me know if I could pass any more information that might help.

device info clarification

in the readme it mentions the following:

"Modify the list of devices in screenshots.yaml to your selected devices.
Confirm that each selected device name matches a name used in screens.yaml"

however it's unclear if the specific device info from screens.yaml should be merged into screenshots.yaml (under devices:) or if that screens.yaml is intended to reside at the same level as screenshots.yaml

Not recognizing 'adb'

When attempting to run Screenshots using flutter pub run screenshots:main I receive an error stating: "'adb' must be in the PATH to use Screenshots" even though I'm able to type adb and get the version and location of its location.

NoSuchMethodError: The method '[]' was called on null.

after the normal installation from the example, this is the error that I got from screenshots version 1.1.1

NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("name")
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
#1      _findDevice.<anonymous closure> (package:screenshots/src/run.dart:257:60)
#2      _ListBase&Object&ListMixin.firstWhere (dart:collection/list.dart:137:15)
#3      _findDevice (package:screenshots/src/run.dart:245:26)
#4      runTestsOnAll (package:screenshots/src/run.dart:102:20)
<asynchronous suspension>
#5      run (package:screenshots/src/run.dart:54:9)
<asynchronous suspension>
#6      main (file:///Users/keanghok/.pub-cache/hosted/pub.dartlang.org/screenshots-1.1.1/bin/main.dart:86:9)
<asynchronous suspension>
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

"Screenshots expects no devices to be running at startup"

I get this error, because isAnyDeviceRunning() in the utils.dart file checks if the command flutter devices contains the string "No devices detected.". However, in the latest flutter version it detects macOS and web also as device.

ios + travis :: exception starting driver test

I've got the ios screenshot job to start in travis, however it's throwing an exception when trying to start my driver test test_driver/smoke.dart

Application failed to start. Will not run test. Quitting.

Upgrading project.pbxproj of Runner.app' to include the 'flutter_assets' directory
Running pod install...                                           2.8s
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Finding Podfile changes
      - Crashlytics
      - Fabric
      - Flutter
      - background_fetch
      - connectivity
      - device_info
      - flutter_background_geolocation
      - flutter_crashlytics
      - flutter_local_notifications
      - geocoder
      - local_auth
      - package_info
      - path_provider
      - shared_preferences
      - sqflite
      - url_launcher
    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `background_fetch` from `.symlinks/plugins/background_fetch/ios`
    -> Fetching podspec for `connectivity` from `.symlinks/plugins/connectivity/ios`
    -> Fetching podspec for `device_info` from `.symlinks/plugins/device_info/ios`
    -> Fetching podspec for `flutter_background_geolocation` from `.symlinks/plugins/flutter_background_geolocation/ios`
    -> Fetching podspec for `flutter_crashlytics` from `.symlinks/plugins/flutter_crashlytics/ios`
    -> Fetching podspec for `flutter_local_notifications` from `.symlinks/plugins/flutter_local_notifications/ios`
    -> Fetching podspec for `geocoder` from `.symlinks/plugins/geocoder/ios`
    -> Fetching podspec for `local_auth` from `.symlinks/plugins/local_auth/ios`
    -> Fetching podspec for `package_info` from `.symlinks/plugins/package_info/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`
    Resolving dependencies of `Podfile`
    [!] CocoaPods could not find compatible versions for pod "Crashlytics":
      In snapshot (Podfile.lock):
        Crashlytics (= 3.12.0)
      In Podfile:
        flutter_crashlytics (from `.symlinks/plugins/flutter_crashlytics/ios`) was resolved to 0.0.1, which depends on
          Crashlytics
    It seems like you've changed the constraints of dependency `Crashlytics` inside your development pod `flutter_crashlytics`.
    You should run `pod update Crashlytics` to apply changes you've made.
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `tap'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolution.rb:182:in `resolve'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/molinillo-0.6.5/lib/molinillo/resolver.rb:43:in `resolve'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/resolver.rb:123:in `resolve'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:781:in `block in resolve_dependencies'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
    /Users/travis/.rvm/gems/ruby-2.4.3/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
    /Users/travis/.rvm/gems/ruby-2.4.3/bin/pod:23:in `load'
    /Users/travis/.rvm/gems/ruby-2.4.3/bin/pod:23:in `<main>'
    /Users/travis/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `eval'
    /Users/travis/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:15:in `<main>'
Error running pod install
Application failed to start. Will not run test. Quitting.
Unhandled exception:
command failed: cmd='flutter drive test_driver/smoke.dart'
#0      streamCmd (package:screenshots/utils.dart:63:7)
<asynchronous suspension>
#1      screenshots (package:screenshots/screenshots.dart:100:9)
<asynchronous suspension>
#2      run (package:screenshots/screenshots.dart:70:17)
<asynchronous suspension>
#3      main (file:///Users/travis/.pub-cache/hosted/pub.dartlang.org/screenshots-0.1.4/bin/main.dart:63:9)
<asynchronous suspension>
#4      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
The command "screenshots" exited with 255.

the - tar cvzf and zip -r jobs proceed with 0 exit codes although there aren't any images stored to archive

Null pointer when starting emulator for mac devices

unable to start emulator for mac devices, simulatorInfo is null:

$ screenshots
Starting emulator: Nexus_5X ...
Capturing screenshots with test test_driver/full_app.dart on emulator Nexus 5X in locale en-US ...
Using device Android SDK built for x86.
Starting application: test_driver/full_app.dart
Initializing gradle...                                           0.8s
Resolving dependencies...                                        1.4s
Installing build/app/outputs/apk/app.apk...                      2.0s
Gradle task 'assembleDebug'...                                   1.4s
Built build/app/outputs/apk/debug/app-debug.apk.
I/flutter ( 5111): Observatory listening on http://127.0.0.1:36003/
00:00 +0: scrolling performance test (setUpAll)
00:00 +0: scrolling performance test screenshots
Screenshot created
Screenshot created
Screenshot created
00:12 +1: scrolling performance test (tearDownAll)
00:12 +1: All tests passed!
Stopping application instance.
Processing screenshots from test...
moving screenshots to android/fastlane/metadata/android/en-US/images/phoneScreenshots
Stopping emulator: Nexus_5X ...
Emulator is stopped
simulatorInfo=null
Starting simulator: iPad Pro (12.9-inch) (2nd generation) ...
Unhandled exception:
NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: []("status")
#0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
#1      simulator (package:screenshots/screenshots.dart:116:22)
#2      run (package:screenshots/screenshots.dart:54:7)
<asynchronous suspension>
#3      main (file:///Users/xxx/.pub-cache/hosted/pub.dartlang.org/screenshots-0.1.0/bin/main.dart:67:3)
<asynchronous suspension>
#4      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#5      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

$ xcrun simctl list

== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone 8 (com.apple.CoreSimulator.SimDeviceType.iPhone-8)
iPhone 8 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPhone X (com.apple.CoreSimulator.SimDeviceType.iPhone-X)
iPhone Xs (com.apple.CoreSimulator.SimDeviceType.iPhone-XS)
iPhone Xs Max (com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max)
iPhone Xʀ (com.apple.CoreSimulator.SimDeviceType.iPhone-XR)
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2)
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina)
iPad Air (com.apple.CoreSimulator.SimDeviceType.iPad-Air)
iPad Air 2 (com.apple.CoreSimulator.SimDeviceType.iPad-Air-2)
iPad (5th generation) (com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation-)
iPad Pro (9.7-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch-)
iPad Pro (12.9-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro)
iPad Pro (12.9-inch) (2nd generation) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation-)
iPad Pro (10.5-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch-)
iPad (6th generation) (com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation-)
iPad Pro (11-inch) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch-)
iPad Pro (12.9-inch) (3rd generation) (com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation-)
Apple TV (com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p)
Apple TV 4K (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K)
Apple TV 4K (at 1080p) (com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p)
Apple Watch - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm)
Apple Watch - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm)
Apple Watch Series 2 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm)
Apple Watch Series 2 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm)
Apple Watch Series 3 - 38mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm)
Apple Watch Series 3 - 42mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm)
Apple Watch Series 4 - 40mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm)
Apple Watch Series 4 - 44mm (com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm)
== Runtimes ==
iOS 12.1 (12.1 - 16B91) - com.apple.CoreSimulator.SimRuntime.iOS-12-1 
tvOS 12.1 (12.1 - 16J602) - com.apple.CoreSimulator.SimRuntime.tvOS-12-1 
watchOS 5.1 (5.1 - 16R591) - com.apple.CoreSimulator.SimRuntime.watchOS-5-1 
== Devices ==
-- iOS 12.1 --
    iPhone 5s (9D9C5874-5228-4CDD-B9CB-602B12F83E4C) (Shutdown) 
    iPhone 6 (9178173A-67D2-4A5F-9F29-AA257C210597) (Shutdown) 
    iPhone 6 Plus (29E6CAB0-B580-4851-B043-7B078BCD13B6) (Shutdown) 
    iPhone 6s (E2754CCD-5659-46B9-BD11-6DDE30BEA3BE) (Shutdown) 
    iPhone 6s Plus (BC8A2B08-481F-4272-B477-7BABAD772965) (Shutdown) 
    iPhone 7 (8F3C16AC-C8B4-4D67-890A-8FDB1AFEBC4A) (Shutdown) 
    iPhone 7 Plus (CD2CE152-87D7-49CA-91CC-D6807E62C091) (Shutdown) 
    iPhone 8 (DABB9131-09E4-43DA-BF05-F3C5B44AECEB) (Shutdown) 
    iPhone 8 Plus (89AC9776-DDC5-4B93-982C-39C402EB66A8) (Shutdown) 
    iPhone SE (90984237-8734-4744-B3DF-C73CB2124096) (Shutdown) 
    iPhone X (3708943A-66B5-44D8-95FD-B9C7D1DA618F) (Shutdown) 
    iPhone XS (669E7266-04DC-4BAA-9AD6-6261D0031772) (Shutdown) 
    iPhone XS Max (8841B488-B02A-4E16-9FA6-588BFF95DD8C) (Shutdown) 
    iPhone XR (448602B0-7586-4936-BC29-5998ED4173F0) (Shutdown) 
    iPad Air (FA6D2EE6-C0EC-4F3A-B0FE-F12311A28134) (Shutdown) 
    iPad Air 2 (5E50FCCB-DAE0-4198-A443-80BCC20AF304) (Shutdown) 
    iPad (5th generation) (EAC28DDE-D6FB-40E6-B8C5-2137E7CD0CE0) (Shutdown) 
    iPad Pro (9.7-inch) (768AF28B-E05C-4101-83CF-4CF9FBC6034E) (Shutdown) 
    iPad Pro (12.9-inch) (0DD14CC8-4D97-428B-B2B6-90AB37A2A891) (Shutdown) 
    iPad Pro (12.9-inch) (2nd generation) (3BF25AC7-AD3E-48DC-AB13-710C5EECC4BC) (Shutdown) 
    iPad Pro (10.5-inch) (0716DBE3-C09C-49DC-AE4E-36865EF119F2) (Shutdown) 
    iPad (6th generation) (D6A156B1-3EB7-4A63-9165-8D3F15F605EE) (Shutdown) 
    iPad Pro (11-inch) (5AE98892-A24A-4EFD-8749-404E7130C772) (Shutdown) 
    iPad Pro (12.9-inch) (3rd generation) (1634CBDF-4B3E-4D8F-AF56-26E2B5C28378) (Shutdown) 
-- tvOS 12.1 --
    Apple TV (FD20C35B-A1C1-48F1-BFD6-053D8797A6E8) (Shutdown) 
    Apple TV 4K (23596911-3D4B-4498-9C4B-CD65E85B1D37) (Shutdown) 
    Apple TV 4K (at 1080p) (A9ECC6CE-527B-4A74-985A-05E3D1AEEA4E) (Shutdown) 
-- watchOS 5.1 --
    Apple Watch Series 2 - 38mm (564A1B89-B926-4461-A49C-3B9D074F5DF9) (Shutdown) 
    Apple Watch Series 2 - 42mm (17F9D296-8D95-4AB2-B926-59B397622508) (Shutdown) 
    Apple Watch Series 3 - 38mm (280ADB5B-DF09-4A00-A953-0D71B47C64E5) (Shutdown) 
    Apple Watch Series 3 - 42mm (ADFB6087-2EFA-40AB-A145-1FED4F519FD8) (Shutdown) 
    Apple Watch Series 4 - 40mm (3D75ED51-7F35-4970-8E3F-17FD7BD48342) (Shutdown) 
    Apple Watch Series 4 - 44mm (24FFEE80-3D05-4180-80BC-7771A3DBB1DB) (Shutdown) 
== Device Pairs ==
79921F10-19CF-4BDD-A881-6748B283508C (active, disconnected)
    Watch: Apple Watch Series 4 - 40mm (3D75ED51-7F35-4970-8E3F-17FD7BD48342) (Shutdown)
    Phone: iPhone XS (669E7266-04DC-4BAA-9AD6-6261D0031772) (Shutdown)
486A6E47-2140-4731-A3C8-C96099EC7A87 (active, disconnected)
    Watch: Apple Watch Series 4 - 44mm (24FFEE80-3D05-4180-80BC-7771A3DBB1DB) (Shutdown)
    Phone: iPhone XS Max (8841B488-B02A-4E16-9FA6-588BFF95DD8C) (Shutdown)

Somehow, i've a whitespace after xxx(Shutdown)_ so the regex does not work:

r'^    (.*) \((.*-.*-.*-.*)\) \((.*)\)$'

should be something like?

r'^    (.*) \((.*-.*-.*-.*)\) \((.*)\)\s*$'

iOS simulator picks invalid runtime

There's still something wrong with the iOS Simulator startup. I tried the iPhone 7 emulator first. This gives me a crash.

Warning: multiple versions of 'iPhone 7 Plus' detected.
  Using 'iPhone 7 Plus' with iOS: com.apple.CoreSimulator.SimRuntime.iOS-10-2, ID: D57FA1F5-FD57-436F-A543-5247734BD99C.
Clearing images in ios/fastlane/screenshots/en-US for 'iPhone 7 Plus'...
Starting simulator 'iPhone 7 Plus' in locale en-US ...
2019-03-13 18:40:30.262 simctl[59751:3714254] *** Assertion failure in -[SimDevice _onBootstrapQueue_bootWithOptions:error:](), /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-581.2/CoreSimulator/SimDevice.m:1776
2019-03-13 18:40:30.263 simctl[59751:3714254] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to determine runtime bundle when booting device.'
When i list all emulators, i get a whole lot.
== Devices ==
-- iOS 12.1 --
    iPhone 5s (48A4B3DF-7317-4D4F-816A-0FA43C141EE5) (Shutdown) 
    iPhone 6 (6C034618-CAD1-45EC-8111-E6216286C791) (Shutdown) 
    iPhone 6 Plus (264B37B5-C582-4CB6-87D0-7F128D94EFF1) (Shutdown) 
    iPhone 6s (68CD5D10-C9F3-42D8-82A3-B2945D3DE9B1) (Shutdown) 
    iPhone 6s Plus (CEB24A97-8B6C-47A5-A22A-8BAEAF2DB578) (Shutdown) 
    iPhone 7 (914F888B-89E3-4D17-B523-3C567F3E79F9) (Shutdown) 
    iPhone 7 Plus (3C644A33-F15A-42AF-BEE3-9BEABEAD433B) (Shutdown) 
    iPhone 8 (E5654150-F0D9-498C-9B27-2720DD2B4308) (Shutdown) 
    iPhone 8 Plus (651D7CAD-F10E-4F29-A004-BF7682FC564B) (Shutdown) 
    iPhone SE (479FCF1E-1977-48A6-8C13-BD77A817EB1F) (Shutdown) 
    iPhone X (19C0AC26-2C61-4410-AA26-D80BA4D26550) (Shutdown) 
    iPhone XS (37A3E376-1ABD-4CC6-8968-BD425464FDA7) (Shutdown) 
    iPhone XS Max (16FE00B2-FB94-4F25-A224-0857F1225868) (Shutdown) 
    iPhone XR (4B291B52-1BD3-4744-9496-C5FFF43E4E28) (Shutdown) 
    iPad Air (100F16DA-6922-4290-8D59-2691785BEF1A) (Shutdown) 
    iPad Air 2 (F14818FC-11AE-4857-B34B-5782AB2DDFC2) (Shutdown) 
    iPad (5th generation) (CAD28D5A-5670-42E4-9B94-CB80264B9EE5) (Shutdown) 
    iPad Pro (9.7-inch) (B917E1E0-E1CD-4AFD-91C7-6E7B679F67A8) (Shutdown) 
    iPad Pro (12.9-inch) (57FFF748-6532-4F5D-A2BA-47BC4B1E0B9A) (Shutdown) 
    iPad Pro (12.9-inch) (2nd generation) (6A3D7313-33FF-4CDF-B58B-CB4F001626F8) (Shutdown) 
    iPad Pro (10.5-inch) (01800A81-3B5C-4148-AD6C-61393B1C94A0) (Shutdown) 
    iPad (6th generation) (90926B35-DE79-4BBC-BE0A-201B514EC3B1) (Shutdown) 
    iPad Pro (11-inch) (BD076FA4-BAD1-45F4-A358-33B68E3CBCFE) (Shutdown) 
    iPad Pro (12.9-inch) (3rd generation) (0515DCBB-8989-4B0E-BCEF-FEE18556B331) (Shutdown) 
-- tvOS 12.1 --
    Apple TV (702C1A58-C38F-4CDF-B7C7-D8DD264B1BF6) (Shutdown) 
    Apple TV 4K (21DB9DD8-B346-4E2D-A66C-099424081B87) (Shutdown) 
    Apple TV 4K (at 1080p) (83F9D203-6AE1-4119-A5E3-840C98288BCC) (Shutdown) 
-- watchOS 5.1 --
    Apple Watch Series 2 - 38mm (139314AB-93D3-4F34-9DB9-F63110A8415A) (Shutdown) 
    Apple Watch Series 2 - 42mm (C102C576-754E-4D11-972E-1542E280687F) (Shutdown) 
    Apple Watch Series 3 - 38mm (9744D8F9-9849-4008-8D9A-30D2A3730138) (Shutdown) 
    Apple Watch Series 3 - 42mm (FFB049F6-AC89-4469-8F6C-DC4E822D2DD6) (Shutdown) 
    Apple Watch Series 4 - 40mm (A8E3215A-A430-4DD7-9FCA-5C5B42E86135) (Shutdown) 
    Apple Watch Series 4 - 44mm (D525299B-26D2-4C66-85A7-266E8BA7616F) (Shutdown) 
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-10-0 --
    iPhone 5 (E71018EA-D5B7-475F-9628-85DB0CF3FBAD) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5s (E7A400C1-706C-4023-A071-53F25A929EC1) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (204C9181-DFE8-432D-A418-9DDE960968F5) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (EF965896-3147-4577-87DB-FF5E8059C27C) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (58C7CEF2-82B9-40B3-8B8F-B13F120E53BF) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (DF5D93B0-B113-481E-B028-31C7C1CD1257) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (8CC496BC-200A-4359-8104-A0DF7D4AF989) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (8294AB99-FABF-415F-9B11-F265AC6185B3) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (9D8D2A17-3E0A-4C89-BDD8-30E2E7594FD5) (Shutdown) (unavailable, runtime profile not found)
    iPad Retina (543E435A-27ED-4948-A1C2-3EE65FA2DF96) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (A5D88BDA-1BDB-40C0-800A-19E2B9499356) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (C0814A54-718D-42A5-A956-2D18B5211F54) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7 inch) (9EA12EA9-938F-4118-A28F-EC02A70704FF) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9 inch) (12983390-CEE9-4D21-885A-FCDA7256D432) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-10-2 --
    iPhone 5 (B4393AFD-CD56-42A1-81AF-4B738B22E788) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5s (E64A14F8-C991-4928-9E8C-3F5C2539DB1F) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (47963D09-90BC-4783-B22F-AF6C6160FA3A) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (2376C35B-1DE6-4AE1-8E86-080DC9D56C0A) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (294B416C-0FB6-4056-8480-BD1788C4A364) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (7782216D-D915-412A-A027-DFC7B8EE7571) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (60AC7E77-EEDE-4912-B190-6DFBD8FCE4CF) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (D57FA1F5-FD57-436F-A543-5247734BD99C) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (8AE0C724-2039-4266-B07B-95CEBF0C325C) (Shutdown) (unavailable, runtime profile not found)
    iPad Retina (011F27F7-FDAA-41F7-9C83-BA9A0F0A8687) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (1256A7AB-817D-4B72-AD18-6E7901910B8B) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (D0DF8AA1-A144-4CE5-B2BE-87306B6F6929) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7 inch) (180C267E-FD51-463A-9ABD-0D0EEE4023CC) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9 inch) (3644AFDF-4A43-4CFF-BEC1-90B01F014346) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-11-0 --
    iPhone 5s (754C5D9C-81C1-40BF-B06B-5124AB461FC4) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (E6FDC2DC-973D-46D3-A075-1A6B87E040DA) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (7B4FC935-4C5B-4A63-9863-B7C1871FD187) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (2541E8D4-EC94-44CD-9519-9B64BFE29FA4) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (6C668CE5-D2C7-4A94-B0A9-67DAA27E595E) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (3CE75F25-962A-4E36-B69C-FE134520B53B) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (0FEDFBCD-D8A0-4616-A68E-C700BA6FD780) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 (993C6A39-8CEE-4D13-8B2F-3F9C1439C22E) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 Plus (F7D03722-382A-4A6C-9443-1E705588C5D9) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (02591F0A-8609-4130-92D6-A9CEA81A8F44) (Shutdown) (unavailable, runtime profile not found)
    iPhone X (95299166-A539-4713-BDD3-D77EDFD87A07) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (FBF75433-4F1F-4449-ADA7-FAD91A468FA2) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (8DC7B411-8BF2-48DD-A6B1-17430BC9B832) (Shutdown) (unavailable, runtime profile not found)
    iPad (5th generation) (834BA01F-8E09-4EAC-88C6-963324F81D44) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7-inch) (FA2D49EB-7D90-4FB3-8E6A-25E59B79F454) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (A1141E71-368C-4DE9-9393-CE88BB4EBF81) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2nd generation) (AA497A7A-9DC4-4CCF-8915-42D23A395128) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (10.5-inch) (A8E18381-87B0-48BB-97F1-D327F6B165CD) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-11-1 --
    iPhone 5s (2EF01986-2C4E-46E5-A5AA-B576993C15C4) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (4E10D677-E748-44BB-97F3-E2035F94EE96) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (FC8B5E6E-5956-4615-A7FF-FFB5488EAFB1) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (A045EFE8-99AE-41C0-B6CA-C17ABC175E10) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (26249E22-D476-4EAE-AFCA-230C9F4719E0) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (71558127-823F-4D16-AA13-AA36B5A74CD0) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (C0D126F3-0AC7-44AB-AC26-8029FAE13732) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 (A54AF665-18A0-4FFC-962E-209DF8B0D927) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 Plus (204D9723-29A7-41F8-AFC4-A1AB6E78BB1D) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (B8475EA7-86CB-4629-B687-C8FD3CE583DA) (Shutdown) (unavailable, runtime profile not found)
    iPhone X (530F9C6F-DC4B-4302-8A04-C2A885F51B2F) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (6608B12E-2FB0-4AC9-84D5-435633D6A20F) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (C9BC3C10-DABE-4E5C-8C3C-93A0A271D505) (Shutdown) (unavailable, runtime profile not found)
    iPad (5th generation) (D6DF8793-FFDF-4EBC-9F03-AFA76CD7569A) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7-inch) (BF518C83-55F9-4959-94E4-A900EB2EEF48) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (0D9719C0-8254-4B48-8380-AA19703707B9) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2nd generation) (B9183529-88EE-442E-8F5C-F1EDF36F2446) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (10.5-inch) (139BBA77-C25F-4D84-8AA9-0FFCEAEBFD5F) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-11-2 --
    iPhone 5s (529B72D8-ACD4-47BA-9CF7-1BABCC4528EA) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (B6DD3462-66DA-4D9E-B74C-D13E8E438FDA) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (E9D68484-1DFC-4C47-954B-FDE92AE76C59) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s (3EE63CEA-84EE-4FE9-832B-2F87075C9EA0) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6s Plus (CABF4A15-B229-4293-B52C-1D2FC4B4F5F8) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 (44224711-3B03-491F-8B2C-AC8077BD0FFB) (Shutdown) (unavailable, runtime profile not found)
    iPhone 7 Plus (3D913659-FD52-4F95-995D-ACE8D49F354E) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 (56F7414A-8A73-4F12-8DF8-67CD08CF48FE) (Shutdown) (unavailable, runtime profile not found)
    iPhone 8 Plus (853F8B05-8E77-426C-BAF7-A9B4FFB7923C) (Shutdown) (unavailable, runtime profile not found)
    iPhone SE (2B1648CC-7B27-4F1F-9C06-3D8A994C7F8B) (Shutdown) (unavailable, runtime profile not found)
    iPhone X (D7D5B0F6-8D74-4E08-9E71-F561CB753932) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (3448BE93-4B7B-45E7-BA58-F653256077E4) (Shutdown) (unavailable, runtime profile not found)
    iPad Air 2 (95DE165D-0595-4559-A79E-1DFDDA819BC4) (Shutdown) (unavailable, runtime profile not found)
    iPad (5th generation) (5B840293-9D0F-4AE2-BF97-4D953A47C73D) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (9.7-inch) (496053CA-282A-4247-9726-65FC28570EAF) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2BCA4554-6D62-4B7B-AB53-313770BB67E6) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (12.9-inch) (2nd generation) (A6369818-CD70-4404-AA53-94884B957F0A) (Shutdown) (unavailable, runtime profile not found)
    iPad Pro (10.5-inch) (96840ABB-91B0-4301-BA6D-27A8B9B70F4A) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-8-0 --
    iPhone 4s (5E1F54E1-DD47-4967-A880-808AAB2FAB18) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5 (B1C200B2-AA95-48E3-AD98-CAD68F92F135) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5s (000CD3BC-D785-4B30-B797-9B9334188D28) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (06F3C2E5-8F69-4858-8216-0CBC91D05E30) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (A1F8361B-E553-47D2-904F-3FCC920D8FE4) (Shutdown) (unavailable, runtime profile not found)
    iPad 2 (B0DA2F65-2109-4834-8C50-F874F5307700) (Shutdown) (unavailable, runtime profile not found)
    iPad Retina (065B6FC2-AB96-4ACA-8035-49B5BA0E6639) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (C3A60BDD-A35F-478B-A3B4-FFB0FC989911) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPad (DC030696-1CD4-4164-9ADA-1B0D28E75821) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPhone (1A29C631-A7BF-4E00-9EE8-E73615D4A73C) (Shutdown) (unavailable, runtime profile not found)
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-8-1 --
    iPhone 4s (5B01B3C9-FF3B-428D-B612-D07802D7576D) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5 (F6DCD89A-77AC-4A0B-A604-FD3F419731AC) (Shutdown) (unavailable, runtime profile not found)
    iPhone 5s (79FCDDBF-0A46-4ED5-B5A3-BA6552B16F2D) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 (401C99E0-50CA-4760-B76E-3D695E6D9841) (Shutdown) (unavailable, runtime profile not found)
    iPhone 6 Plus (318638EE-AF9A-40EF-95CC-64F73ADC98F7) (Shutdown) (unavailable, runtime profile not found)
    iPad 2 (FC5B7A9B-0F07-4433-BD64-8BA0B45E6F38) (Shutdown) (unavailable, runtime profile not found)
    iPad Retina (807D5198-DC04-4DCA-997F-5E7C95935A39) (Shutdown) (unavailable, runtime profile not found)
    iPad Air (EF5B0810-EFAA-4CA0-9447-3087A96D5345) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPad (29F65C50-CF93-47A1-8B13-3A84FA1B4B82) (Shutdown) (unavailable, runtime profile not found)
    Resizable iPhone (D43DE1C5-0F84-4871-87DB-0AF7143F8C2F) (Shutdown) (unavailable, runtime profile not found)

... and a bunch more. I see that i only have the 12.1 runtime installed. The ID mentioned in the crash is listed, but with the 10.2 runtime. So that is what I installed next. I run screenshots again. But this time, the 11.2 runtime is picked!

Warning: multiple versions of 'iPhone 7 Plus' detected.
  Using 'iPhone 7 Plus' with iOS: com.apple.CoreSimulator.SimRuntime.iOS-11-2, ID: 3D913659-FD52-4F95-995D-ACE8D49F354E.
Clearing images in ios/fastlane/screenshots/en-US for 'iPhone 7 Plus'...
Starting simulator 'iPhone 7 Plus' in locale en-US ...
2019-03-13 18:57:37.876 simctl[61235:3723917] *** Assertion failure in -[SimDevice _onBootstrapQueue_bootWithOptions:error:](), /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-581.2/CoreSimulator/SimDevice.m:1776
2019-03-13 18:57:37.877 simctl[61235:3723917] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to determine runtime bundle when booting device.'

Not giving up and now installing the 11.2 runtime. We'll see who wins :-)
I read in one of the closed issues that there was a problem with determining the correct ID's. Maybe these different runtime versions have something to do with it?

Fastlane Configuration

README.md says that this plugin can work with fastlane, but since I am new to fastlane it is not exactly clear how I create a lane that will make use of this plugin.

Can someone provide me with an example fastfile lane configuration that will run the screenshots plugin and then upload those screenshots to the apple and android app stores?

I would love to contribute this to the README if someone can point me in the right direction.

Add support for running on real devices in cloud

Use https://pub.dev/packages/sylph to run screenshots on real devices in the cloud.

Sylph is a new command line utility for running integration tests on real devices in the cloud.

Sylph runs tests in a pool of devices. Each test is run with only one real device attached at a time. So screenshots would have to be modified to detect it is running in the cloud and run only for the currently attached real device.
After testing is complete and the screenshots downloaded, then, for supported screens, framing can occur.

Add feature to run on real devices

Enhance screenshots to run on attached real devices as well as emulators.

This involves detecting real devices that match supported screens, or any device if framing is set to false, and including in run.

Error: simulator not installed for device 'iPhone XS Max' in screenshots.yaml.

I'm trying to take screenshot on iPhone XS Max
Have the simulator installed (I guess I just need to open that simulator once to install it)
Now when I run screenshots I get this error

Error: simulator not installed for device 'iPhone XS Max' in screenshots.yaml.

Install the missing simulator or use a supported device with an installed simulator in screenshots.yaml.

Guide:
  Installed emulators:
    
  Installed simulators:
    Apple TV
    Apple TV 4K
    Apple TV 4K (at 1080p)
    Apple Watch Series 2 - 38mm
    Apple Watch Series 2 - 42mm
    Apple Watch Series 3 - 38mm
    Apple Watch Series 3 - 42mm
    Apple Watch Series 4 - 40mm
    Apple Watch Series 4 - 44mm
    iPhone 5s
    iPhone 6
    iPhone 6 Plus
    iPhone 6s
    iPhone 6s Plus
    iPhone 7
    iPhone 7 Plus
    iPhone 8
    iPhone 8 Plus
    iPhone SE
    iPhone X
    iPhone Xs
    iPhone Xs Max
    iPhone Xʀ
    iPad Air (3rd generation)
    iPad Air
    iPad Air 2
    iPad (5th generation)
    iPad Pro (9.7-inch)
    iPad Pro (12.9-inch)
    iPad Pro (12.9-inch) (2nd generation)
    iPad Pro (10.5-inch)
    iPad (6th generation)
    iPad Pro (11-inch)
    iPad Pro (12.9-inch) (3rd generation)

  Devices with supported screens:
    android:
      Nexus 6P
      Nexus 5X
      Nexus 9
    ios:
      iPhone 7 Plus
      iPad Pro (12.9-inch) (3rd generation)
      iPad Pro (12.9-inch) (2nd generation)
      iPhone XS Max
      iPhone X
      iPhone XS

  Each device listed in screenshots.yaml must have a supported screen and emulator/simulator.

Though it says Error: simulator not installed for device 'iPhone XS Max' in screenshots.yaml. it's (iPhone XS Max) listed down in the message under Installed simulators

screenshot.yaml

# A list of screen capture tests
tests:
  - test/widget_test.dart

# Note: flutter driver expects a pair of files for testing
# For example:
#   main1.dart is the test app (that calls your app)
#   main1_test.dart is the matching test that flutter driver
#   expects to find.

# Interim location of screenshots from tests
staging: /tmp/screenshots

# A list of locales supported by the app
locales:
  - en-US

# A map of devices to emulate
devices:
  ios:
    iPhone XS Max:
      frame: false
#    iPad Pro (12.9-inch) (3rd generation):
#  android:
#    Nexus 6P:

# Frame screenshots
frame: true

Does not work on flutter master

Hi,

screenshots does not work against master, even though flutter drive does. The output I'm getting is:

> screenshots
Warning: 'Nexus 6P' does not have a matching emulator.
       : Using 'Nexus_6P_API_28'.
Clearing images in ios/fastlane/screenshots/en-AU for 'iPhone X'...
Clearing images in ios/fastlane/screenshots/en-AU for 'iPad Pro (12.9-inch) (2nd generation)'...
Clearing images in android/fastlane/metadata/android/en-AU/images/phoneScreenshots for 'Nexus 6P'...
Starting emulator 'Nexus 6P' in locale en-AU ...
Emulator is ready
Capturing screenshots with test app test_driver/app.dart on emulator 'Nexus 6P' in locale en-AU ...
Using device Android SDK built for x86.
Starting application: test_driver/app.dart
Initializing gradle...                                              1.2s
Resolving dependencies...                                           2.4s
Installing build/app/outputs/apk/app.apk...                         3.4s
Running Gradle task 'assembleDebug'...                          
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Running Gradle task 'assembleDebug'...                             10.9s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                         3.0s
I/flutter (26014): Observatory listening on http://127.0.0.1:32813/bp9xbtUc2jc=/
00:00 +0: Screenshots (setUpAll)
Waiting for flutter driver to connect.

And there is just hangs. It does the same thing if I disable Android and just use iOS.

iPhone X status bar white on light gray

The status bar in my iPhone X screenshots are generated with white on light gray so look peculiar.

Screen Shot 2019-04-24 at 12 45 05 AM

In the actual simulator I have black text over light gray.

Perhaps you have some dark mode enabled for your simulator, but it seems to me the library should look at what color the status bar is in the captured screen shot and decide whether it should overlay black or white on top of it.

unhandled exception running `screenshots`

Hi @mmcc007 ,

I've followed your docs / repo / article and am not able to get screenshots to generate from my flutter driver tests. I keep getting the following error when running from my project and also from your screenshots repo:

~/workspace/mmcc007/screenshots/example master
❯ screenshots
Unhandled exception:
ProcessException: No such file or directory
  Command: emulator -list-avds
#0      _ProcessImpl._runAndWait (dart:io/runtime/binprocess_patch.dart:488:7)
#1      _runNonInteractiveProcessSync (dart:io/runtime/binprocess_patch.dart:633:18)
#2      Process.runSync (dart:io/runtime/binprocess_patch.dart:66:12)
#3      cmd (package:screenshots/utils.dart:32:26)
#4      emulators (package:screenshots/utils.dart:87:10)
#5      Config.validate (package:screenshots/config.dart:29:30)
<asynchronous suspension>
#6      run (package:screenshots/screenshots.dart:31:16)
<asynchronous suspension>
#7      main (file:///Users/zanuka/.pub-cache/hosted/pub.dartlang.org/screenshots-0.1.4/bin/main.dart:63:9)
<asynchronous suspension>
#8      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:287:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

Did I miss a step about creating a directory somewhere?

Really looking forward to getting this package working both in our local workflow and in Travis CI.

Cheers,

Mike

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.