<commit_before><!--

title: Test iOS applications
short_title: iOS
last_updated: August 28, 2015

-->

CircleCI now offers Beta support for building and testing iOS (and OSX) projects.
To enable this feature, go to **Project Settings > Experimental Settings** and
enable the "Build iOS project" experimental setting. This will cause builds for
this project to be run on OSX machines rather than the usual Linux containers,
and iOS-related build and test commands will be automatically inferred.


## Basic setup

Simple projects should run with minimal or no configuration. By default,
CircleCI will:

* **Install any Ruby gems specified in a Gemfile** - You can install a specific
  version of CocoaPods or other gems this way.
* **Install any dependencies managed by [CocoaPods](http://cocoapods.org/)**
* **Run the "test" build action for detected workspace (or project) and scheme
  from the command line using `xctool`** - If a workspace is detected, it
  will take precedence over a project and be used to call `xctool`. The
  detected settings can be overridden with [environment variables](#environment-variables)

See [customizing your build](#customizing-your-build) for more information about
customization options.

## Xcode Version

By default, CircleCI will build your project with Xcode 6.4. You can select 7.0, 7.1 or 7.2
by specifying the version in a [circle.yml file](/docs/configuration) in the root of your
repo. For example, for 7.2, add the following:

```
machine:
  xcode:
    version: 7.2
```

## Shared Schemes
Your scheme (what you select in the dropdown next to the run/stop buttons in
Xcode) must be shared (there is a checkbox for this at the bottom of the
"Edit scheme" screen in Xcode) so that CircleCI can run the appropriate build
action. After doing this you will have a new `.xcscheme` file located in the
`xcshareddata/xcschemes` folder under your Xcode project. You will need to
commit this file to your git repository so that CircleCI can access it.

If more than one scheme is present, then you should specify the
`XCODE_SCHEME` [environment variable](/docs/environment-variables#custom).
Otherwise a scheme will be chosen arbitrarily.

### CocoaPods

CircleCI will automatically detect if your project is using [CocoaPods](http://cocoapods.org/)
to manage dependencies. If you are using CocoaPods, then we recommend that you
check your [Pods directory into source control](http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control).
This will ensure that you have a deterministic, reproducable build.

If CircleCI finds a `Podfile` and no `Pods` directory, then we will run
`pod install` to install the necessary dependencies in the `dependencies`
step of your build.

##Supported build and test tools

CircleCI's automatic commands cover a lot of common test patterns, and you can customize your build
as needed to satisfy almost any iOS build and test strategy.

###XCTest-based tools
In addition to standard `XCTestCase` tests, CircleCI will automatically run tests
written in any other tool that builds on top of XCTest and is configured to run
via the "test" build action. The following test tools are known to work well on CircleCI
(though many others should work just fine):

* [XCTest](https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/testing_with_xcode/Introduction/Introduction.html)
* [Kiwi](https://github.com/kiwi-bdd/Kiwi)
* [KIF](https://github.com/kif-framework/KIF)

###Other tools
Popular iOS testing tools like [Appium](http://appium.io/) and [Frank](http://www.testingwithfrank.com/) should also
work normally, though they will need to be installed and called using custom commands.
See [customizing your build](#customizing-your-build) for more info.
<commit_msg>Detail exactly when `pod install` is run.<commit_after><!--

title: Test iOS applications
short_title: iOS
last_updated: August 28, 2015

-->

CircleCI now offers Beta support for building and testing iOS (and OSX) projects.
To enable this feature, go to **Project Settings > Experimental Settings** and
enable the "Build iOS project" experimental setting. This will cause builds for
this project to be run on OSX machines rather than the usual Linux containers,
and iOS-related build and test commands will be automatically inferred.


## Basic setup

Simple projects should run with minimal or no configuration. By default,
CircleCI will:

* **Install any Ruby gems specified in a Gemfile** - You can install a specific
  version of CocoaPods or other gems this way.
* **Install any dependencies managed by [CocoaPods](http://cocoapods.org/)**
* **Run the "test" build action for detected workspace (or project) and scheme
  from the command line using `xctool`** - If a workspace is detected, it
  will take precedence over a project and be used to call `xctool`. The
  detected settings can be overridden with [environment variables](#environment-variables)

See [customizing your build](#customizing-your-build) for more information about
customization options.

## Xcode Version

By default, CircleCI will build your project with Xcode 6.4. You can select 7.0, 7.1 or 7.2
by specifying the version in a [circle.yml file](/docs/configuration) in the root of your
repo. For example, for 7.2, add the following:

```
machine:
  xcode:
    version: 7.2
```

## Shared Schemes
Your scheme (what you select in the dropdown next to the run/stop buttons in
Xcode) must be shared (there is a checkbox for this at the bottom of the
"Edit scheme" screen in Xcode) so that CircleCI can run the appropriate build
action. After doing this you will have a new `.xcscheme` file located in the
`xcshareddata/xcschemes` folder under your Xcode project. You will need to
commit this file to your git repository so that CircleCI can access it.

If more than one scheme is present, then you should specify the
`XCODE_SCHEME` [environment variable](/docs/environment-variables#custom).
Otherwise a scheme will be chosen arbitrarily.

### CocoaPods

CircleCI will automatically detect if your project is using [CocoaPods](http://cocoapods.org/)
to manage dependencies. If you are using CocoaPods, then we recommend that you
check your [Pods directory into source control](http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control).
This will ensure that you have a deterministic, reproducable build.

If CircleCI finds a `Podfile` and the `Pods` directory is not present (or empty)
 then we will run `pod install` to install the necessary dependencies in the
`dependencies` step of your build.

We cannot handle all setups automatically, so for some projects you might need
to invoke CocoaPods manually with some custom configuration. To do this you will
need to override the `dependencies` section of your `circle.yml` file.
See our [documentation on overriding build phases for more information on this.](/docs/configuration#phases).
If you need more help please reach out to our support team who are always happy
to help out.

## Supported build and test tools

CircleCI's automatic commands cover a lot of common test patterns, and you can customize your build
as needed to satisfy almost any iOS build and test strategy.

###XCTest-based tools
In addition to standard `XCTestCase` tests, CircleCI will automatically run tests
written in any other tool that builds on top of XCTest and is configured to run
via the "test" build action. The following test tools are known to work well on CircleCI
(though many others should work just fine):

* [XCTest](https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/testing_with_xcode/Introduction/Introduction.html)
* [Kiwi](https://github.com/kiwi-bdd/Kiwi)
* [KIF](https://github.com/kif-framework/KIF)

###Other tools
Popular iOS testing tools like [Appium](http://appium.io/) and [Frank](http://www.testingwithfrank.com/) should also
work normally, though they will need to be installed and called using custom commands.
See [customizing your build](#customizing-your-build) for more info.

{'fraction_non_alphanumeric': 0.07402837754472548, 'fraction_numerical': 0.004441702652683528, 'mean_word_length': 4.7286219081272085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1436301', 'n_tokens_mistral': 2257, 'n_tokens_neox': 2141, 'n_words': 1085}