Skip to content
Run Unit Tests in Xcode Playgrounds
Swift Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status Version License Platform

Unit Tests in Xcode Playgrounds ?

Playgrounds are a great way to prototype and (quickly) iterate on your codebase. However, Unit Tests are often left behind, or an afterthought.

It would be great to iterate on your unit tests as well! Unfortunately, Playgrounds do not support importing XCTest (yet).

Note: This is true as of Xcode 7.2.1

Enter PlaygroundTesting!



PlaygroundTesting is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PlaygroundTesting"

To use PlaygroundTesting in your Playgrounds, you need to follow Apple's Guidelines for Importing Custom Frameworks into Playgrounds:

  • The framework is in the same workspace as the playground.
  • The framework has already been built.
  • The workspace contains at least one active scheme that builds a target.


PlaygroundTesting is very flexible. You can

  • Use XCTAssert & Friends directly on the Playground.
  • Create a Test Case Type that implements TestCaseProtocol and run its tests.
  • Run individual tests

The example project includes a sample Playground. To run the Playground, clone the repo, and run pod install from the Example directory first.


Daniel Rodriguez,


PlaygroundTesting is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.