fastlane: "Malformed version number" when iOS12 simulators are installed

New Issue Checklist

Issue Description

Two weeks ago fastlane was working fine on my iMac. Last week I installed Xcode10-Beta with the iOS12 simulators. Now when I run fastlane screenshot I get the following error: Malformed version number string com.apple.CoreSimulator.SimRuntime.iOS-12-0

Complete output when running fastlane, including the stack trace and command used
[konrad@iMac Sporttotal]$ fastlane screenshots --capture_output
[✔] 🚀 
DEBUG [2018-06-11 19:00:59.12]: Checking if there are any plugins that should be loaded...
INFO [2018-06-11 19:00:59.22]: ------------------------------
INFO [2018-06-11 19:00:59.22]: --- Step: default_platform ---
INFO [2018-06-11 19:00:59.22]: ------------------------------
INFO [2018-06-11 19:00:59.22]: Driving the lane 'ios screenshots' 🚀
INFO [2018-06-11 19:00:59.22]: ---------------------------------
INFO [2018-06-11 19:00:59.22]: --- Step: capture_screenshots ---
INFO [2018-06-11 19:00:59.22]: ---------------------------------
INFO [2018-06-11 19:00:59.72]: Successfully loaded '/Users/konrad/Documents/Sporttotal/fastlane/Snapfile' đź“„
DEBUG [2018-06-11 19:00:59.72]: Fetching available simulator devices
INFO [2018-06-11 19:00:59.92]: $ xcodebuild -showBuildSettings -scheme Snapshot -project Sporttotal.xcodeproj
DEBUG [2018-06-11 19:01:01.53]: Fetching available simulator devices
DEBUG [2018-06-11 19:01:01.71]: Found 23 simulators.
DEBUG [2018-06-11 19:01:01.71]: Fetching available simulator devices
DEBUG [2018-06-11 19:01:01.89]: Checking that helper files contain SnapshotHelperVersion [1.10]
INFO [2018-06-11 19:01:01.93]: Building and running project - this might take some time...
DEBUG [2018-06-11 19:01:01.93]: Fetching available simulator devices
WARN [2018-06-11 19:01:02.11]: Lane Context:
INFO [2018-06-11 19:01:02.11]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios screenshots"}
ERROR [2018-06-11 19:01:02.11]: Malformed version number string com.apple.CoreSimulator.SimRuntime.iOS-12-0
INFO [2018-06-11 19:01:02.11]: Successfully generated documentation at path '/Users/konrad/Documents/Sporttotal/fastlane/README.md'
ERROR [2018-06-11 19:01:02.12]: fastlane finished with errors

/Users/konrad/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:208:in initialize': [!] Malformed version number string com.apple.CoreSimulator.SimRuntime.iOS-12-0 (ArgumentError) from /Users/konrad/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:199:in new’ from /Users/konrad/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:199:in new' from /Users/konrad/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/rubygems/version.rb:190:in create’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane_core/lib/fastlane_core/device_manager.rb:130:in block in latest_simulator_version_for_device' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane_core/lib/fastlane_core/device_manager.rb:130:in each’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane_core/lib/fastlane_core/device_manager.rb:130:in sort_by' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane_core/lib/fastlane_core/device_manager.rb:130:in latest_simulator_version_for_device’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:62:in block (3 levels) in take_screenshots_simultaneously' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:62:in each’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:62:in group_by' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:62:in block (2 levels) in take_screenshots_simultaneously’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:46:in each' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:46:in each_with_index’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:46:in block in take_screenshots_simultaneously' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:45:in each’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb:45:in take_screenshots_simultaneously' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/snapshot/lib/snapshot/runner.rb:45:in work’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/actions/capture_ios_screenshots.rb:14:in run' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:257:in block (2 levels) in execute_action’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in execute_action' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:236:in block in execute_action’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:231:in chdir' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:231:in execute_action’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:157:in trigger_action_by_name' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/fast_file.rb:149:in method_missing’ from Fastfile:21:in block (2 levels) in parsing_binding' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/lane.rb:33:in call’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:49:in block in execute' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:45:in chdir’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/runner.rb:45:in execute' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/lane_manager.rb:59:in cruise_lane’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/command_line_handler.rb:36:in handle' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/commands_generator.rb:107:in block (2 levels) in run’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in call' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in run’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in run_active_command' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in run!’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in run!' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/commands_generator.rb:332:in run’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/commands_generator.rb:41:in start' from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in take_off’ from /Users/konrad/.rvm/gems/ruby-2.4.1/gems/fastlane-2.97.0/bin/fastlane:20:in <top (required)>' from /Users/konrad/.rvm/gems/ruby-2.4.1/bin/fastlane:23:in load’ from /Users/konrad/.rvm/gems/ruby-2.4.1/bin/fastlane:23:in <main>' from /Users/konrad/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in eval’ from /Users/konrad/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

Environment

âś… fastlane environment âś…

Stack

Key Value
OS 10.13.4
Ruby 2.4.1
Bundler? false
Git git version 2.15.1 (Apple Git-101)
Installation Source ~/.rvm/gems/ruby-2.4.1/bin/fastlane
Host Mac OS X 10.13.4 (17E202)
Ruby Lib Dir ~/.rvm/rubies/ruby-2.4.1/lib
OpenSSL Version OpenSSL 1.1.0h 27 Mar 2018
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 9.4

System Locale

Variable Value
LANG en_US.UTF-8 âś…
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "Generate new localized screenshots"
  lane :screenshots do
capture_screenshots(project: "Sporttotal.xcodeproj", scheme: "Snapshot", reinstall_app: true, app_identifier: "de.sporttotal.sporttotal", number_of_retries: 0)
  end
end

`./fastlane/Appfile`
app_identifier("de.sporttotal.sporttotal") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
#     https://docs.fastlane.tools/advanced/#appfile

fastlane gems

Gem Version Update-Status
fastlane 2.97.0 âś… Up-To-Date

Loaded fastlane plugins:

No plugins Loaded

Loaded gems
Gem Version
executable-hooks 1.3.2
bundler-unload 1.0.2
rubygems-bundler 1.4.4
bundler 1.16.2
slack-notifier 2.3.2
atomos 0.1.2
CFPropertyList 2.3.5
claide 1.0.2
colored2 3.1.2
nanaimo 0.2.5
xcodeproj 1.5.9
rouge 2.0.7
xcpretty 0.2.8
terminal-notifier 1.8.0
unicode-display_width 1.4.0
terminal-table 1.8.0
plist 3.4.0
public_suffix 2.0.5
addressable 2.5.2
multipart-post 2.0.0
word_wrap 1.0.0
tty-screen 0.6.4
tty-cursor 0.5.0
tty-spinner 0.8.0
babosa 1.0.2
colored 1.2
highline 1.7.10
commander-fastlane 4.4.6
excon 0.62.0
faraday 0.15.2
unf_ext 0.0.7.5
unf 0.1.4
domain_name 0.5.20180417
http-cookie 1.0.3
faraday-cookie_jar 0.0.6
fastimage 2.1.3
gh_inspector 1.1.3
json 1.8.1
mini_magick 4.5.1
multi_json 1.13.1
multi_xml 0.6.0
rubyzip 1.2.1
security 0.1.3
xcpretty-travis-formatter 1.0.0
dotenv 2.4.0
faraday_middleware 0.12.2
naturally 2.2.0
simctl 1.6.4
uber 0.1.0
declarative 0.0.10
declarative-option 0.1.0
representable 3.0.4
retriable 3.1.2
mime-types-data 3.2016.0521
mime-types 3.1
little-plugger 1.1.4
logging 2.2.2
jwt 2.1.0
memoist 0.16.0
os 0.9.6
signet 0.8.1
googleauth 0.6.2
httpclient 2.8.3
google-api-client 0.21.2
emoji_regex 0.1.1

generated on: 2018-06-11

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 17 (1 by maintainers)

Most upvoted comments

i don’t think this directly related to Xcode 10 Beta. I didn’t install it, but i still have a similar issue I get the same error for the string:

com.apple.CoreSimulator.SimRuntime.iOS-11-4

The issue was that i have two xcode versions installed Xcode 9.4.1 and Xcode 9.2 xcode-select was pointing at Xcode 9.2.

I added a log statement in detect_values.rb line 84 and printed all os_version attributes: 10.3.1 11.2 4.2 com.apple.CoreSimulator.SimRuntime.iOS-11-4 When I monkeypatch a guard in line 84, it could select a simulator. would it make sense to offer a PR for this guard ?

We ran into the same issue and what has helped was to reset all the Simulator devices.

We’ve ended up using a method based on the :erase_simulator lane as mentioned in https://github.com/fastlane/fastlane/issues/11572#issuecomment-381002708

I ran into the same issue, on a CI agent that switched between Xcode 9.2 and Xcode 9.4 depending on which project/branch was being built. What appears to be happening is that (for example) Xcode 9.4 starts an iOS 11.4 simulator, but then when the Xcode 9.2 branch tries to parse the simulators it throws this Malformed Version error. Apparently Fastlane correctly excludes simulators listed as “unavailable”, unless the simulator in question is in the booted state. Simulators that are listed as “unavailable” (even those that are booted) don’t have the expected version format, and so an exception is thrown.

One way around the issue is to explicitly shut down all simulators, which will then ensure that Fastlane’s existing exclusion rules will exclude the “unavailable” simulator. One way to do this is to add the following to a before_all lane:

UI.message "Shutting down all simulators"
`xcrun simctl shutdown all &> /dev/null`

There may be unexpected consequences from doing this, but it seems preferable to deleting the simulators, since it still allows other branches/projects to use the simulators that your branch considers “unavailable” (due to it’s selected Xcode version).

Ideally device_manager.rb would be updated to correctly ignore such unavailable simulators, or detect_values.rb would be updated to better handle invalid versions. I’m not really sure what the right solution is in this case.

As others, I have 2 Xcode installs: 9.4.1 and 10 beta 4. My solutions was to go back to default command line tool path (part of Xcode 9.4.1).

Use sudo xcode-select --reset

Not the solution we want, but as a temporary fix it’s perfect until fastlane comes with an update.