fastlane: fastlane snapshot doesn't work with defaults in Xcode 9

Steps to reproduce

  • Install Xcode 9.0.1
  • Run it once and make sure the Simulators show the default simulators
  • Don’t list any simulators in your Snapfile
  • Run fastlane snapshot for any project

Expected result: 😃

Actual result

...
[10:38:13]: Exit status: 70
[10:38:13]: Tests failed while running on: iPhone 7, iPhone 7 Plus, iPhone 8
[10:38:13]: For more detail about the test failures, check the logs here:
[10:38:13]: /Users/fkrause/Library/Logs/snapshot/Themoji-ThemojiUITests.log
[10:38:13]:
[10:38:13]: You can also find the test result data here:
[10:38:13]: /var/folders/8q/f0rt7xtj4pd8q6vgh_mk2p4c00dw80/T/snapshot_derived20171019-62355-m0lnlx/Logs/Test
[10:38:13]:
[10:38:13]: You can find the incomplete screenshots here:
[10:38:13]: /Users/fkrause/Library/Caches/tools.fastlane/screenshots
[10:38:13]: /Users/fkrause/Developer/demo/MyApp/fastlane/screenshots
[10:38:13]: Caught error... 70
[10:38:13]: Patching all simulators '/Users/fkrause/Library/Preferences/com.apple.iphonesimulator.plist' to scale to 100%
[10:38:16]: Running snapshot on: iPhone 7, iPhone 7 Plus, iPhone 8
[10:38:16]: $ set -o pipefail && xcodebuild -workspace ./Themoji.xcworkspace -scheme ThemojiUITests -derivedDataPath '/var/folders/8q/f0rt7xtj4pd8q6vgh_mk2p4c00dw80/T/snapshot_derived20171019-62355-m0lnlx' -destination 'platform=iOS Simulator,name=iPhone 7,OS=11.0' -destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=11.0' -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.0' FASTLANE_SNAPSHOT=YES build test | tee -a /Users/fkrause/Library/Logs/snapshot/Themoji-ThemojiUITests.log | xcpretty
[10:38:16]: ▸ Loading...
[10:39:17]: ▸ xcodebuild: error: Unable to find a destination matching the provided destination specifier:
[10:39:17]: ▸ { platform:iOS Simulator, OS:11.0, name:iPhone 7 }
[10:39:17]: ▸ The requested device could not be found because no available devices matched the request.
[10:39:17]: ▸ Available destinations for the "ThemojiUITests" scheme:
[10:39:17]: ▸ { platform:iOS Simulator, id:1C2EFE08-1606-475E-AAB8-E211A90D674F, OS:11.0.1, name:iPad (5th generation) }
[10:39:17]: ▸ { platform:iOS Simulator, id:FE0308C2-7B80-4B14-B105-629F3191B86D, OS:11.0.1, name:iPad Air }
[10:39:17]: ▸ { platform:iOS Simulator, id:EF1497DA-7817-422B-8371-AB67CEFF769D, OS:11.0.1, name:iPad Air 2 }
[10:39:17]: ▸ { platform:iOS Simulator, id:2392C682-E770-4A8D-8BD6-A7231753F35C, OS:11.0.1, name:iPad Pro (9.7-inch) }
[10:39:17]: ▸ { platform:iOS Simulator, id:5ECC6A87-A7D2-4A21-9CCB-25B6F2254D3C, OS:11.0.1, name:iPad Pro (10.5-inch) }
[10:39:17]: ▸ { platform:iOS Simulator, id:CAAB46D5-9B8F-42EE-8F1B-D2D037173C2B, OS:11.0.1, name:iPad Pro (12.9-inch) }
[10:39:17]: ▸ { platform:iOS Simulator, id:4F37337A-5198-4F49-9807-F8BE2E3F1F7A, OS:11.0.1, name:iPad Pro (12.9-inch) (2nd generation) }
[10:39:17]: ▸ { platform:iOS Simulator, id:F640F748-CCDA-461A-B68E-847E78D6257C, OS:11.0.1, name:iPhone 5s }
[10:39:17]: ▸ { platform:iOS Simulator, id:724A820D-5416-44D5-B77D-CF01BFE7F8EC, OS:11.0.1, name:iPhone 6 }
[10:39:17]: ▸ { platform:iOS Simulator, id:8BE56D3E-AAD9-4BF8-A2CD-3EC62A6B0ED5, OS:11.0.1, name:iPhone 6 Plus }
[10:39:17]: ▸ { platform:iOS Simulator, id:328EEBFD-EE3C-4A18-A4FB-5478BCFE5144, OS:11.0.1, name:iPhone 6s }
[10:39:17]: ▸ { platform:iOS Simulator, id:9B3DB586-FD09-42E2-A461-2B7931B67694, OS:11.0.1, name:iPhone 6s Plus }
[10:39:17]: ▸ { platform:iOS Simulator, id:55E0C241-464B-4B81-A6FC-C11DCF14A91D, OS:11.0.1, name:iPhone 7 }
[10:39:17]: ▸ { platform:iOS Simulator, id:FF3EFE85-94C2-4180-B42E-B0CE67A2C3BB, OS:11.0.1, name:iPhone 7 Plus }
[10:39:17]: ▸ { platform:iOS Simulator, id:5D6E6A73-3E29-4CBD-97B0-D1E5FB175D70, OS:11.0.1, name:iPhone 8 }
[10:39:17]: ▸ { platform:iOS Simulator, id:56F29D10-3F1F-4EDD-83B0-2F4F07350B23, OS:11.0.1, name:iPhone 8 Plus }
[10:39:17]: ▸ { platform:iOS Simulator, id:4831D1EA-BE20-4E4C-A8C2-0136C2917BB4, OS:11.0.1, name:iPhone SE }
[10:39:17]: ▸ { platform:iOS Simulator, id:DCF29BB3-B24C-4ED0-A62A-8280DDA476D0, OS:11.0.1, name:iPhone X }
[10:39:17]: ▸ Ineligible destinations for the "ThemojiUITests" scheme:
[10:39:17]: ▸ { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
[10:39:17]: ▸ { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:11.0, name:iPhone 7 }

The requested device could not be found because no available devices matched the request.

Available destinations for the "ThemojiUITests" scheme:
{ platform:iOS Simulator, id:1C2EFE08-1606-475E-AAB8-E211A90D674F, OS:11.0.1, name:iPad (5th generation) }
{ platform:iOS Simulator, id:FE0308C2-7B80-4B14-B105-629F3191B86D, OS:11.0.1, name:iPad Air }
{ platform:iOS Simulator, id:EF1497DA-7817-422B-8371-AB67CEFF769D, OS:11.0.1, name:iPad Air 2 }
{ platform:iOS Simulator, id:2392C682-E770-4A8D-8BD6-A7231753F35C, OS:11.0.1, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:5ECC6A87-A7D2-4A21-9CCB-25B6F2254D3C, OS:11.0.1, name:iPad Pro (10.5-inch) }
{ platform:iOS Simulator, id:CAAB46D5-9B8F-42EE-8F1B-D2D037173C2B, OS:11.0.1, name:iPad Pro (12.9-inch) }
{ platform:iOS Simulator, id:4F37337A-5198-4F49-9807-F8BE2E3F1F7A, OS:11.0.1, name:iPad Pro (12.9-inch) (2nd generation) }
{ platform:iOS Simulator, id:F640F748-CCDA-461A-B68E-847E78D6257C, OS:11.0.1, name:iPhone 5s }
{ platform:iOS Simulator, id:724A820D-5416-44D5-B77D-CF01BFE7F8EC, OS:11.0.1, name:iPhone 6 }
{ platform:iOS Simulator, id:8BE56D3E-AAD9-4BF8-A2CD-3EC62A6B0ED5, OS:11.0.1, name:iPhone 6 Plus }
{ platform:iOS Simulator, id:328EEBFD-EE3C-4A18-A4FB-5478BCFE5144, OS:11.0.1, name:iPhone 6s }
{ platform:iOS Simulator, id:9B3DB586-FD09-42E2-A461-2B7931B67694, OS:11.0.1, name:iPhone 6s Plus }
{ platform:iOS Simulator, id:55E0C241-464B-4B81-A6FC-C11DCF14A91D, OS:11.0.1, name:iPhone 7 }
{ platform:iOS Simulator, id:FF3EFE85-94C2-4180-B42E-B0CE67A2C3BB, OS:11.0.1, name:iPhone 7 Plus }
{ platform:iOS Simulator, id:5D6E6A73-3E29-4CBD-97B0-D1E5FB175D70, OS:11.0.1, name:iPhone 8 }
{ platform:iOS Simulator, id:56F29D10-3F1F-4EDD-83B0-2F4F07350B23, OS:11.0.1, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:4831D1EA-BE20-4E4C-A8C2-0136C2917BB4, OS:11.0.1, name:iPhone SE }
{ platform:iOS Simulator, id:DCF29BB3-B24C-4ED0-A62A-8280DDA476D0, OS:11.0.1, name:iPhone X }

Ineligible destinations for the "ThemojiUITests" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }
[10:39:17]: Exit status: 70
[10:39:17]: Tests failed while running on: iPhone 7, iPhone 7 Plus, iPhone 8
[10:39:17]: For more detail about the test failures, check the logs here:
[10:39:17]: /Users/fkrause/Library/Logs/snapshot/Themoji-ThemojiUITests.log
[10:39:17]:
[10:39:17]: You can also find the test result data here:
[10:39:17]: /var/folders/8q/f0rt7xtj4pd8q6vgh_mk2p4c00dw80/T/snapshot_derived20171019-62355-m0lnlx/Logs/Test
[10:39:17]:
[10:39:17]: You can find the incomplete screenshots here:
[10:39:17]: /Users/fkrause/Library/Caches/tools.fastlane/screenshots
[10:39:17]: /Users/fkrause/Developer/demo/MyApp/fastlane/screenshots
[10:39:17]: Caught error... 70

Related issue, the output tells me to find the incomplete screenshots at /Users/fkrause/Library/Caches/tools.fastlane/screenshots, which is not true, as the simulator never even launched. It might be nice to change the message to not show that if there is no files in that directory.

Also

[10:39:17]: You can also find the test result data here:
[10:39:17]: /var/folders/8q/f0rt7xtj4pd8q6vgh_mk2p4c00dw80/T/snapshot_derived20171019-62355-m0lnlx/Logs/Test

is also not available on my machine

I haven’t investigated the root of the issue, and wanted to check first if someone else experience the same problem.

The reason why this should be addressed is that I didn’t specify any simulators, and snapshot should be able to work with that setup.

Also, if that happens, and the solution is fastlane snapshot reset_simulators (in this case it isn’t), then we should print that out as well 👍

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 19 (4 by maintainers)

Most upvoted comments

add this line to your Snapfile:

ios_version ‘11.0.1’

Cheers

This is fixed with Xcode 9.1.

@viplord Try removing the semicolon so that in your Snapfile it reads ios_version '11.0.1'

Earlier today, I ran this successfully in Terminal like this:

fastlane snapshot -i 11.0.1