fastlane / fastlane

๐Ÿš€ The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.62k stars 5.72k forks source link

Scan cannot find simulators #5742

Closed postmechanical closed 8 years ago

postmechanical commented 8 years ago

New Issue Checklist

Scan cannot find simulators

Complete output when running fastlane, including the stack trace and command used
bundle exec scan --device "iPhone 6s"
[17:01:54]: Ignoring 'iPhone 6s', couldn't find matching simulator
[17:01:54]: Couldn't find any matching simulators for '["iPhone 6s"]' - falling back to default simulator
+-----------------------+--------------------------------------------------------------------------+
|                                     Summary for scan 0.11.2                                      |
+-----------------------+--------------------------------------------------------------------------+
| device                | iPhone 6s                                                                |
| workspace             | ./Foobar.xcworkspace                                                   |
| scheme                | Foobar                                                                 |
| derived_data_path     | .../DerivedData/Foobar-... |
| clean                 | false                                                                    |
| code_coverage         | false                                                                    |
| address_sanitizer     | false                                                                    |
| skip_build            | false                                                                    |
| output_directory      | ./fastlane/test_output                                                   |
| output_types          | html,junit                                                               |
| buildlog_path         | ~/Library/Logs/scan                                                      |
| open_report           | false                                                                    |
| skip_slack            | false                                                                    |
| slack_only_on_failure | false                                                                    |
| use_clang_report_name | false                                                                    |
+-----------------------+--------------------------------------------------------------------------+

[17:05:15]: $ set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace ./Foobar.xcworkspace -scheme Foobar -destination 'platform=iOS Simulator,id=2732721F-BB19-4019-8594-56B1F1EE4981' -derivedDataPath '/Users/ragecode/Library/Developer/Xcode/DerivedData/Foobar-byiivdizifwfoqejwrhhgjtcjuly' build test | tee '/Users/ragecode/Library/Logs/scan/Foobar-Foobar.log' | xcpretty 

Output of instruments -s:

instruments -s
Known Devices:
ragebookpro [F7FFE450-8C45-56F6-8AC9-2FD8768657F5]
Apple TV 1080p (9.2) [5FB0ABEA-9B96-4AB0-B85E-E65EFA3E17CF] (Simulator)
iPad 2 (9.3) [8D9B2FA3-95EE-41F8-92C6-C35C765C9242] (Simulator)
iPad Air (9.3) [76486C39-4F1F-437B-A8F7-40A29FB1BC4E] (Simulator)
iPad Air 2 (9.3) [4B07F52F-D02C-4DB9-A35A-09F93639BF52] (Simulator)
iPad Pro (9.3) [B813E2BE-E780-496D-AB3A-B75FA0AC8D93] (Simulator)
iPad Retina (9.3) [FF1CB7C6-60B3-4C96-BCF0-E8717590C6AD] (Simulator)
iPhone 4s (9.3) [4A0C9D6C-35B9-4161-B67D-FCFDAEFDE583] (Simulator)
iPhone 5 (9.3) [290A73D6-2334-4B19-B22C-6DF0023549E2] (Simulator)
iPhone 5s (9.3) [2732721F-BB19-4019-8594-56B1F1EE4981] (Simulator)
iPhone 6 (9.3) [60ED7DD2-EA31-43E9-BA72-F2A960F9CA6E] (Simulator)
iPhone 6 Plus (9.3) [4CE88860-2EC2-4A0B-9794-310E9D8B25D4] (Simulator)
iPhone 6s (9.3) [3F5C6BBB-96BB-4A75-AF61-6AE993F04289] (Simulator)
iPhone 6s (9.3) + Apple Watch - 38mm (2.2) [C1D65072-E256-4438-98C6-17996190C888] (Simulator)
iPhone 6s Plus (9.3) [B3DF44A4-D531-4FF7-9ACA-C82BEF01E2DC] (Simulator)
iPhone 6s Plus (9.3) + Apple Watch - 42mm (2.2) [EE2BEDA7-700D-4366-97D9-DFF59AE6BDBA] (Simulator)
Known Templates:
"Activity Monitor"
"Allocations"
"Automation"
"Blank"
"Cocoa Layout"
"Core Animation"
"Core Data"
"Counters"
"Energy Log"
"File Activity"
"GPU Driver"
"Leaks"
"Metal System Trace"
"Network"
"OpenGL ES Analysis"
"System Trace"
"System Usage"
"Time Profiler"
"Zombies"
"~/Library/Application Support/Instruments/Templates/MyTemplate.tracetemplate"

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

N/A

Environment

scan version (run scan -v):

0.11.2

Do you use bundler to execute fastlane (i.e. bundle exec scan)? YES

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? NO

postmechanical commented 8 years ago

Backed down to fastlane 1.97.2 with scan 0.8.0 and the problem went away.

FranzBusch commented 8 years ago

Same issue here

jdhealy commented 8 years ago

From https://github.com/fastlane/fastlane/pull/5640/commits/b3e805ae68ce14aca654fd81bcf43f1c30943b2b from #5640:

The old logic allowed 'iPhone 6' to match on 'iPhone 6 8.1' even when the Xcode target required 9.3 or better.

Seems like the new logic only matches simulators with the exact version from the project's IPHONEOS_DEPLOYMENT_TARGET, which doesn't seem like desired behavior.

giacgbj commented 8 years ago

I hope this is the same bug just fixed for #5731 orโ€ฆI don't understand how to use "--device".

vpolouchkine commented 8 years ago

I believe this was fixed in https://github.com/fastlane/fastlane/pull/5744

postmechanical commented 8 years ago

Still getting same error with scan 0.11.3.

giacgbj commented 8 years ago

@postmechanical If it's related to #5731, you have to wait for the Fastlane release instead of the Scan release.

postmechanical commented 8 years ago

Still getting same error with fastlane 1.100.0

giacgbj commented 8 years ago

@postmechanical This ticket is still open and will be closed in the next release, which is not the 1.100.0 one.

OSemenovBoyarka commented 8 years ago

Issue still exists in fastlane 1.101.0, #5744 has nothing to do with this. As far, as I can see from code in #5640 and @jdhealy corretly mentioned new logic looks for simulator with exactly the same iOS version, which is found in deployment target, or version, you specified manually in device name.

So, to workaround it I've specified simulator names with versions, e.g. "iPhone 6s (9.3)" in device parameter.

I think, new logic should look for simulator with same or higher version, than requested, not exactly the same

TKBurner commented 8 years ago

@SemenovAlexander Thanks for following up. What happens if you erase your simulators before running scan? That generally fixes this for affected users. Thanks!

SandyChapman commented 8 years ago

@TKBurner : Erasing the simulator prior to running had no effect for me.

$ xcrun simctl list devices
== Devices ==
-- iOS 9.3 --
    ...
    iPad Air 2 (6D7C718A-D664-4F6D-BA71-80A5985441F7) (Shutdown)
    ...

$ xcrun simctl erase 6D7C718A-D664-4F6D-BA71-80A5985441F7
$ bundle exec fastlane test
...
[00:03:04]: ------------------
[00:03:04]: --- Step: scan ---
[00:03:04]: ------------------
[00:03:04]: xcodebuild -list -workspace ./My\ Project.xcworkspace
[00:03:06]: Ignoring 'iPad Air 2', couldn't find matching simulator
[00:03:06]: Couldn't find any matching simulators for '["iPad Air 2"]' - falling back to default simulator
[00:03:07]: xcodebuild -list -workspace ./My\ Project.xcworkspace
...
[00:03:09]: fastlane finished with errors

As @SemenovAlexander stated, running with the version (i.e. 'iPad Air 2 (9.3)') works.

OSemenovBoyarka commented 8 years ago

@TKBurner actually nothing happens, and nothing should happen, because of code in #5640 written in such manner.

In my projects I have iOS 8.0 deployment target, and all simulators are 9.3. All works fine, if I pass device name with actual version, like this iPhone 6 (9.3) (line 49 in detect_values.rb will work). However, if I pass simulator name without version (e.g. iPhone 6) - scan can't find appropriate simulator, because it tries to find simulator with OS version, which is exactly matching deployment target (which is 8.0). See line 51

Hansteo commented 8 years ago

5640

TKBurner commented 8 years ago

@SemenovAlexander Thanks for following up. I circled back with the core team and we'll update this thread. It seems like this might be expected behavior for now, but certainly isn't desired because it causes lanes to break more often.

postmechanical commented 8 years ago

The biggest problem, of which this one is a small but significant symptom, is that almost every new version of these tools breaks existing workflows.

jdhealy commented 8 years ago

@TKBurner @ohwutup @KrauseFx @mfurtak โ€” Any update yet from the core team? Noticed a new version #6041 with this unaddressed and #5746 (which possibly addresses this, depending on what is actually desired) has been waiting on comments or review for a few weeks nowโ€ฆ

KrauseFx commented 8 years ago

Hey everyone, really sorry there is some difficulties with scan. I'm looking into https://github.com/fastlane/fastlane/pull/5746 right now, and make sure all edge cases are covered.

Thanks for your feedback @postmechanical, I can understand your frustration. The goal with fastlane is to never do any breaking changes, unless there is a major version bump involved. We haven't done any breaking release since the 1.0 release of each of the tools, however things might go wrong, especially for more advanced setups, where some features or tools are used differently than originally intended.

For this scan issue, the error was caused by an Xcode update, changing the way simulators are printed to the terminal, and therefore breaking the simulator selection of scan. We're usually really fast updating the tools to work with the latest releases of Apple (both Xcode, and web services like iTunes Connect), however for some reason we misjudged the priority of this issue and put it aside initially.

I'm really sorry this happened, and we're working hard to provide a new release with a fix as soon as possible ๐Ÿ‘

KrauseFx commented 8 years ago

Short update on this, I just reviewed and merged https://github.com/fastlane/fastlane/pull/5746 (thanks @jdhealy for providing this PR ๐Ÿ‘) and published a follow-up PR with https://github.com/fastlane/fastlane/pull/6054.

Please give the latest version from the master branch a try and let me know if that works for you. Once I get a +1 I'll do a new release for this ๐Ÿš€

SandyChapman commented 8 years ago

@KrauseFx : Works for me.

ChristopherDrum commented 8 years ago

Seems to be working for me as well. ๐Ÿ™‡

TKBurner commented 8 years ago

@SandyChapman @ChristopherDrum Thanks so much for letting us know! Really happy you are back up and running with scan. Hope you have a great weekend ๐Ÿ‘

ricardolpd commented 8 years ago

Hi guys, I am using 1.104.0, and i still have this issue, scan is always reverting to the default simulator even though I have the simulator requested, has this fix made its way to the official release? If so have you guys made any changes to the way to describe simulators in -device

The one we are using is: "platform=iOS Simulator,name=iPhone 5s,OS=9.3" The output given by fastlane is:

[11:41:28]: Ignoring 'platform=iOS Simulator,name=iPhone 6,OS=9.0', couldnโ€™t find matching simulator [11:41:28]: Couldn't find any matching simulators for '["platform=iOS Simulator,name=iPhone 6,OS=9.0"]' - falling back to default simulator [11:41:28]: Found simulator "iPhone 5s (9.3)"

Thanks

SandyChapman commented 8 years ago

@ricardolpd Try using just "iPhone 6" as the simulator name. Or possibly "iPhone 6 (9.0)" if you want to lock the version.

ricardolpd commented 8 years ago

@SandyChapman thanks it works now, it used to work using the device name in that way.