scan, alias for the run_tests action (https://docs.fastlane.tools/actions/run_tests/) automates the process of running tests, and while you can certainly run tests via Xcode, as we have demonstrated in the preceding section, it isn't something you will want to do manually, especially as you take note of all the many test suites we have already. Apple also provides a command-line way of running test scripts, using xcodebuild:
xcodebuild \ -workspace MyApp.xcworkspace \ -scheme "MyApp" \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1' \ test
With scan, we can conduct our testing using one command, fastlane scan, which wraps the previous command into a pretty-formatted output of the results when run via the command line, as well as outputting the results in HTML and JUnit formats. The major...