How to use test scheme in Xcode

Issue #541

Scheme action

A scheme, either for app or test, consists of actions

Run

Used when Cmd+R. The executable specifies which app target to run

Screenshot 2019-12-14 at 23 39 48

Test

Used when Cmd+U. The tests specifies which test target to run

Screenshot 2019-12-14 at 23 40 09

Test target recognises app targets via Test application and target dependency

Screenshot 2019-12-15 at 21 06 24 Screenshot 2019-12-14 at 23 40 48

When specify test scheme, we are specifying Test action in test scheme, which builds test target, and by dependency, builds app target, then run test action in test scheme, which is the UITest

1
xcodebuild -project TestApp.xcodeproj -scheme TestAppUITests test

Scheme build settings

Inspect build settings from test scheme does not work, need to specify app scheme

1
xcodebuild -workspace Animal.xcworkspace -scheme CatUITests -showBuildSettings

Comments