Some of the builds in our environment are failing because the builds are using a 13.X iOS/tvOS simulator and for some reason that causes issues. I made changes to our Fastfile so that the builds use a 14.2 simulator instead and now the builds are succeeding.
Here are the changes I made to the fast file.
First, I declared a dict:
XCODE_DESTINATION = {
iphoneos: "generic/platform=iOS",
iphonesimulator: "platform=iOS Simulator,OS=14.2,name=iPhone 11 Pro Max",
appletvos: "generic/platform=tvOS",
appletvsimulator: "platform=tvOS Simulator,OS=14.2,name=Apple TV 4K"
}
Then, in the run_tests lane for both iOS and tvOS, I reference the iphonesimulator and the appletvsimulator:
run_tests(
destination: XCODE_DESTINATION[:iphonesimulator],
workspace: WORKSPACE_NAME,
scheme: options[:scheme_tests]
)
run_tests(
destination: XCODE_DESTINATION[:appletvsimulator],
workspace: WORKSPACE_NAME,
scheme: options[:scheme_tests]
)
Even though this solution solves the problem, I don't really want the XCODE_DESTINATION dict to have to specifically reference an OS version and a specific device.
Is there a way I can configure this Fastfile so that it runs the tests only if a 14.X simulator is present within XCode without having to specifically indicate that in the dict?
Thank you!