b2cloud

29th May 2013

Manually adding Unit Tests to Xcode

Guides | Tutorial By 4 years ago

If you started an Xcode project a long time ago or just didn’t tick the “Include Unit Tests” box when creating your project, it may be a bit confusing how to get them in. Not to fear, I will show you how.

First, head over your project summary. Down the bottom click the “Add Target” button.

 

Select the Touch Unit Testing Bundle from the Other iOS category.

 

Pretty easy right? Well this doesn’t quite get us to where we would have been by adding the Unit Tests in from the beginning, and this is where most people get stuck…

The standard Unit Tests allow you to use the Command+U shortcut to run the tests for the current target. This wont work yet because our tests are not associated with any target.

Through the menu, select “Product > Scheme > Edit Scheme…”. Make sure your target is selected at the top in the drop down box and select the TestĀ option on the left. Now click the add button and choose your unit test.

 

That’s about it. Now you can run tests with the Command+U shortcut.

If you also want to remove the Unit Test from the Schemes list (as per a project begun with Unit Tests), in the screen above choose Manage Schemes just below the add button, then select the Unit Test and delete it.

Recommended Posts

Yammer integrations in ReactJS

Post by 4 years ago

I am writing this blog while I am working on a project for our client’s intranet website. The client requires the website has the ability to share, like and write comments in the website through

Got an idea?

We help entrepreneurs, organizations and established brands from around
the country bring ideas to life. We would love to hear from you!