I've noticed that there are two options in xcodebuild
's man page.
-only-testing:TEST-IDENTIFIER
constrains testing by specifying tests to include, and excluding other tests
-skip-testing:TEST-IDENTIFIER
constrains testing by specifying tests to exclude, but including other tests
What I try:
xcodebuild -workspace MyWorkSpace.xcworkspace / -sdk iphonesimulator / -destination id=7F52F302-C6AF-4215-B269-39A6F9913D5B / -scheme SCHEME-iOS / test -only-testing:???
What is TEST-IDENTIFIER
mean ?
In general, Xcode has to do tasks like preprocess source files and compile them by compiler, link source code by linker, copy and process resources like headers, asset catalogues and storyboards, And finally code sign and maybe even do some custom work in a shell script or a make file like building API documentation ...
xcodebuild is a command-line tool that offers the ability to build and test your Xcode projects.
It archives your Xcode project by running the xcodebuild archive command and exports the archive into an . ipa file with the xcodebuild -exportArchive command. This . ipa file can be shared and installed on test devices, or uploaded to App Store Connect.
Like what Marcio said, it's a path like string.
For example, say you have a scheme named MyScheme, a test target MyUITests
, and testing class LoginTest
, then testing method testUserLogin
, to run only the method, you can run
xcodebuild -workspace Envoy.xcworkspace \ -scheme MyScheme \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPad Air 2,OS=10.1' '-only-testing:MyUITests/LoginTest/testUserLogin' test
Likewise, if you want to run all tests under LoginTest, here you run
xcodebuild -workspace Envoy.xcworkspace \ -scheme MyScheme \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPad Air 2,OS=10.1' '-only-testing:MyUITests/LoginTest' test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With