Skip to content

Commit

Permalink
Create specific simulators
Browse files Browse the repository at this point in the history
Try fix an issue where CI isn't finding iPhone 16 when its clearly listed by simctl.
  • Loading branch information
pixlwave committed Sep 24, 2024
1 parent 4918662 commit 6d4ecb8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
restore-keys: |
${{ runner.os }}-gems-
- name: Available simulators
run: xcrun simctl list

- name: Setup environment
run:
source ci_scripts/ci_common.sh && setup_github_actions_environment
Expand Down
26 changes: 19 additions & 7 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,21 @@ lane :alpha do
end

lane :unit_tests do |options|
create_simulator_if_necessary(
name: "iPhone 16 (Element X)",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-0"
)

create_simulator_if_necessary(
name: "iPhone SE (Element X)",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-SE-3rd-generation",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-0"
)

run_tests(
scheme: "UnitTests",
device: 'iPhone 16',
device: "iPhone 16 (Element X)",
ensure_devices_found: true,
result_bundle: true,
number_of_retries: 3,
Expand All @@ -91,7 +103,7 @@ lane :unit_tests do |options|
if !options[:skip_previews]
run_tests(
scheme: "PreviewTests",
device: 'iPhone SE (3rd generation)',
device: "iPhone SE (Element X)",
ensure_devices_found: true,
result_bundle: true,
number_of_retries: 3,
Expand All @@ -107,13 +119,13 @@ lane :ui_tests do |options|
# reset_simulator_contents()

create_simulator_if_necessary(
name: "iPhone 16",
name: "iPhone 16 (Element X)",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-0"
)

create_simulator_if_necessary(
name: "iPad (10th generation)",
name: "iPad (Element X)",
type: "com.apple.CoreSimulator.SimDeviceType.iPad-10th-generation",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-0"
)
Expand All @@ -126,7 +138,7 @@ lane :ui_tests do |options|

run_tests(
scheme: "UITests",
devices: ["iPhone 16", "iPad (10th generation)"],
devices: ["iPhone 16 (Element X)", "iPad (Element X)"],
ensure_devices_found: true,
prelaunch_simulator: true,
result_bundle: true,
Expand All @@ -140,14 +152,14 @@ lane :integration_tests do
clear_derived_data()

create_simulator_if_necessary(
name: "iPhone 16 Pro",
name: "iPhone 16 Pro (Element X)",
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro",
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-18-0"
)

run_tests(
scheme: "IntegrationTests",
devices: ["iPhone 16 Pro"],
devices: ["iPhone 16 Pro (Element X)"],
ensure_devices_found: true,
result_bundle: true,
reset_simulator: true
Expand Down

0 comments on commit 6d4ecb8

Please sign in to comment.