iosunit-testingxcode-ui-testinggui-testing

Is there any way to run UITests with out launching iOS Simulator


I have been trying to find a solution to run UI Tests for iOS projects without launching the iOS Simulator. My intention is to run xcodebuild command from Terminal for CI pipeline but without launching the iOS Simulator.

I am using below command to run UI test suite for my iOS project, this works fine but launches the iOS Simulator xcodebuild test -project iOSTesting.xcodeproj -scheme 'iOSTestingUITests' -destination 'platform=iOS Simulator,name=iPhone 15 Pro' -destination 'platform=iOS Simulator,name=iPhone 15'

I was able to find a solution on GitHub where the UI Tests run without launching the iOS Simulator, but I am not able to find out how it is working, here is the link to the source code. https://github.com/Shashikant86/Xcode9-XCTest

Any thoughts?


Solution

  • I was able to reproduce the behavior of the project you pointed to by making a new project and running xcodebuild on it. Follow these steps to try it:

    The tests run but at no time does the Simulator app appear on the screen.