Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7635561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:27:29+00:00 2026-05-31T07:27:29+00:00

I took great pains to make sure Xcode 4.3 was the only version of

  • 0

I took great pains to make sure Xcode 4.3 was the only version of Xcode on my system.

I created a new project (with Git and unit tests). To this project I added a new configuration, copied from Debug, called ‘Coverage’. In the project (not ‘main target’, but ‘project’) I enabled ‘test on build’ for the Coverage configuration. In the main target, I enabled both ‘test coverage’ and ‘instrument program flow’ for the Coverage configuration.

I also added a new scheme, copied from the only other scheme, called ‘Coverage’ as well. The only difference in this scheme is checking the ‘run’ box for the test project in the build action.

I have not changed the DerivedData location in Xcode’s preferences.

Okay, that’s the setup.

When I run xcodebuild -configuration Coverage -sdk iphonesimulator -scheme Coverage build, the output goes to the DerivedData folder as expected and code coverage data is created as expected (after tweaking a script in Xcode, something about TEST_HOST).

When I run xcodebuild -configuration Debug -sdk iphonesimulator build, the output goes to the build directory in the project root. Same with xcodebuild -configuration Release -sdk iphoneos build.

How can I get these standard configurations to generate artifacts in the ‘correct’ (DerivedData) folder?

Bonus question: is there a better way to fix that TEST_HOST thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:27:30+00:00Added an answer on May 31, 2026 at 7:27 am

    So it turns out that xcodebuild requires a -workspace argument to normalize the builds in the DerivedData folder.

    Bonus answer (about TEST_HOST):

    There is a dichotomy between ‘Logic’ tests and ‘Application’ tests that I, as a new iOS developer, was unaware of. If the class you want to test is a subclass of some UI class, that is an ‘Application’ test and must be run on an actual device. Otherwise (derived from an NS class), that test may be run on a simulator. Simulated tests require an empty TEST_HOST.

    Oh, and you’ll want to add each class you want to test directly to your test target’s Build Sources phase under Build Phases manually, because that’s not going to slip your mind, ever.

    Seriously, if someone knows a better way, please comment, or I’ll have to accept my own response as an answer. Please comment also if the information presented is erroneous, which it probably is.

    You have 72 hours. [calmly pets long-haired white cat]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Earlier this year, the intrepid folks of StackOverflow took great pains to provide us
I took over a Visual C++ project in Visual Studio 2005 from a colleague.
Just recently took over a project from my developer. I'm a noob to coding,
I am about to choose hosting provider for my Django project. I took a
At my old C++ job, we always took great care in encapsulating member variables,
I was here yesterday and got some really great answers. I took what I
I had a great editor color theme for Xcode 3.2.4 which helped me coding
I took up the Python programming language because of its design philosophies, its great
I took a data structures class in C++ last year, and consequently implemented all
I took the plunge this afternoon and began studying LINQ, so far just mucking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.