PROJECT=xxxx
SCHEME=xxxx

xcodebuild test \
-project $PROJECT.proj \
-scheme $SCHEME \
-destination "platform=iOS Simulator,OS=15.1,name=iPhone 8" \
-enable

xcodebuild \
-project $PROJECT.xcodeproj \
-scheme $SCHEME \
-destination "platform=iOS Simulator,name=iPhone 8,OS=15.2" \
-enableCodeCoverage YES test

// view xcresult

  • brew install XCTestHtmlReport/xchtmlreport/xchtmlreport