@@ -444,8 +444,11 @@ platform :ios do
444444 lane :build_and_upload_itc do |options |
445445 ensure_sentry_installed
446446
447- ios_build_prechecks ( skip_confirm : options [ :skip_confirm ] , external : true ) unless options [ :skip_prechecks ]
448- ios_build_preflight unless options [ :skip_prechecks ]
447+ unless options [ :skip_prechecks ]
448+ ios_build_prechecks ( skip_confirm : options [ :skip_confirm ] , external : true )
449+ ios_build_preflight
450+ xcversion ( ) # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
451+ end
449452
450453 appstore_code_signing
451454
@@ -501,6 +504,7 @@ platform :ios do
501504 desc 'Builds and uploads an installable build'
502505 lane :build_and_upload_installable_build do
503506 ensure_sentry_installed
507+ xcversion ( ) # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
504508
505509 alpha_code_signing
506510
@@ -577,6 +581,8 @@ platform :ios do
577581 #####################################################################################
578582 desc 'Build for Testing'
579583 lane :build_for_testing do |options |
584+ xcversion ( ) # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
585+
580586 run_tests (
581587 workspace : 'WooCommerce.xcworkspace' ,
582588 scheme : TEST_SCHEME ,
@@ -649,8 +655,8 @@ platform :ios do
649655 # Ensure we're using the latest Pods
650656 sh ( 'bundle exec pod install --verbose' )
651657
652- # Ensure we're using the right version of Xcode
653- xcversion ( version : '~> 13.4' )
658+ # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
659+ xcversion ( )
654660
655661 scan (
656662 workspace : 'WooCommerce.xcworkspace' ,
@@ -662,8 +668,8 @@ platform :ios do
662668
663669 desc 'Take Screenshots'
664670 lane :take_screenshots do |options |
665- # Ensure we're using the right version of Xcode
666- xcversion ( version : '~> 13.4' )
671+ # Ensure we're using the right version of Xcode, defined in `.xcode-version` file
672+ xcversion ( )
667673
668674 # By default, clear previous screenshots
669675 languages = IOS_LOCALES
0 commit comments