1

I am working on CI/CD for iOS development and I'm facing an issue with XCUITest. I want to build the project for testing and then upload the zip to pCloudy service to run test. I tried to run it with fastlane with destination is 'generic/platform=iOS'. But it show the error:

Unable to find a destination matching the provided destination specifier:
        { generic:1, platform:iOS }

It seems like xcodebuild accept the destination Simulator or real devices are connected to the mac

Here is my script:

run_tests(
      destination: 'generic/platform=iOS',
# I also tried with devices param 
#     devices: ['generic/platform=iOS']

      scheme: "appUITests",
      configuration: "Dev",
      derived_data_path: "derived_data",
      build_for_testing: true,
      clean: true,
    )

And the xcodebuild script shows on terminal:

set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace ./app.xcworkspace -scheme appUITests -configuration Dev -derivedDataPath derived_data -destination 'generic/platform=iOS' clean build-for-testing | tee '/Users/xx/Library/Logs/scan/app-app.log' | xcpretty  --report junit --output '/Users/xx/workspace/app-ios/fastlane/test_output/report.junit' --report junit --output '/var/folders/p_/yqdfspgd23x6w10wpdpqw4cm0000gn/T/junit_report20230804-56805-1onkrcb'

Anyone has any ideas how we can build the suite for real device testing?

linh lê
  • 102
  • 5

0 Answers0