Xcode Build: Tests must be run on a concrete device

540 Views Asked by At

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

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

Thanks in advance!

1

There are 1 best solutions below

0
Nandhini On

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.