scan

Easily run tests of your iOS app using scan

More information: https://github.com/fastlane/fastlane/tree/master/scan

scan
Supported platforms ios, mac
Author @KrauseFx

5 Examples

scan
scan(
  workspace: "App.xcworkspace",
  scheme: "MyTests",
  clean: false
)
# Build For Testing
scan(
   derived_data_path: "my_folder",
   build_for_testing: true
)
# run tests using derived data from prev. build
scan(
   derived_data_path: "my_folder",
   test_without_building: true
)
# or run it from an existing xctestrun package
scan(
   xctestrun: "/path/to/mytests.xctestrun"
)

Parameters

Key Description
workspace Path to the workspace file
project Path to the project file
device The name of the simulator type you want to run tests on (e.g. 'iPhone 6')
toolchain The toolchain that should be used for building the application (e.g. com.apple.dt.toolchain.Swift_2_3, org.swift.30p620160816a)
devices Array of devices to run the tests on (e.g. ['iPhone 6', 'iPad Air'])
scheme The project's scheme. Make sure it's marked as Shared
clean Should the project be cleaned before building it?
code_coverage Should code coverage be generated (Xcode 7 only)?
address_sanitizer Should the address sanitizer be turned on?
thread_sanitizer Should the thread sanitizer be turned on?
skip_build Should debug build be skipped before test build?
output_directory The directory in which all reports will be stored
output_style Define how the output should look like (standard, basic, rspec or raw)
output_types Comma separated list of the output types (e.g. html, junit, json-compilation-database)
output_files Comma separated list of the output files, corresponding to the types provided by :output_types (order should match). If specifying an output type of json-compilation-database with :use_clang_report_name enabled, that option will take precedence
buildlog_path The directory where to store the raw log
include_simulator_logs If the logs generated by the app (e.g. using NSLog, perror, etc.) in the Simulator should be written to the output_directory
formatter A custom xcpretty formatter to use
test_without_building Test without building, requires a derived data path
build_for_testing Build for testing only, does not run tests
xctestrun Run tests using the provided .xctestrun file
derived_data_path The directory where build products and other derived data will go
result_bundle Location of the Xcode result bundle
sdk The SDK that should be used for building the application
open_report Should the HTML report be opened when tests are completed?
configuration The configuration to use when building the app. Defaults to 'Release'
destination Use only if you're a pro, use the other options instead
xcargs Pass additional arguments to xcodebuild. Be sure to quote the setting names and values e.g. OTHER_LDFLAGS="-ObjC -lstdc++"
xcconfig Use an extra XCCONFIG file to build your app
only_testing Array of strings matching Test Bundle/Test Suite/Test Cases to run
skip_testing Array of strings matching Test Bundle/Test Suite/Test Cases to skip
slack_url Create an Incoming WebHook for your Slack group to post results there
slack_channel #channel or @username
slack_message The message included with each message posted to slack
skip_slack Don't publish to slack, even when an URL is given
slack_only_on_failure Only post on Slack if the tests fail
use_clang_report_name Generate the json compilation database with clang naming convention (compile_commands.json)
custom_report_file_name [DEPRECATED!] Use --output_files - Sets custom full report file name when generating a single report
fail_build Should this step stop the build if the tests fail? Set this to false if you're using trainer


To show the documentation in your terminal, run

fastlane action scan

View source code


Back to actions