iosswiftpipelinexcodebuild

Xcode Build: Tests must be run on a concrete device


I am trying to build in terminal and git-lab pipeline, using:

xcodebuild test -project Project.xcodeproj -scheme Scheme -destination 'platform=iOS Simulator,name=iPhone 14,OS=13.0' | xcpretty -s

But facing issues like:

xcodebuild: error: Failed to build project Project with scheme Project.: Cannot test target “Tests” on “Any iOS Device”: Tests must be run on a concrete device Cannot test target “UITests” on “Any iOS Device”: Tests must be run on a concrete device.

I am using these:

Minimum Deployment: 13.0

Thanks in advance!


Solution

  • xcodebuild test -project Project.xcodeproj -scheme Scheme -destination 'platform=iOS Simulator,name=iPhone 14' | xcpretty -s

    Using this comment build is completed successfully. Just removed the OS.

    Ref: Running tests for Swift package using xcodebuild: Error tests must be run on a concrete device

    This answer notes point help me.