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

  • Home
  • SEARCH
  • 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 8847461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:11:44+00:00 2026-06-14T12:11:44+00:00

The unit testing environment in Xcode is a bit of a black box to

  • 0

The unit testing environment in Xcode is a bit of a black box to me, but from what I have seen I figure the tests are somehow sticked to the main application and then the whole thing is run, executing the tests instead of the normal app flow.

This is great because it allows me to debug and run the tests both on the Simulator and the real device. (I thought that wasn’t possible, the tests always used to run just on the Simulator, did something change?) But I noticed that during testing the whole app really runs, with all the bells and whistles. This is not really a desirable behaviour, so that I set an environment variable for the Test scheme and if I detect the variable in application:didFinishLaunchingWithOptions: I skip the usual initialization, just put up a dummy window and wait for the test rig to finish.

Is it supposed to work like this? Is there a “standard” way to detect that the app is running just as a host for the test rig? (I’m using the official build of Xcode 4.3, if that matters.)

  • 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-06-14T12:11:45+00:00Added an answer on June 14, 2026 at 12:11 pm

    One option is to stop using the main app as a bundle loader. Instead one can create a bare-bones app (let’s call it TestRunner) that just displays an empty screen and servers as a bundle loader for the test suite:

    • Make the testing target depend on the TestRunner.
    • Set the Bundle Loader of the testing target to $(BUILT_PRODUCTS_DIR)/TestRunner.app/TestRunner.
    • Set the Test Host of the testing target to $(BUNDLE_LOADER).

    This adds an extra target to the project, but keeps the main app target independent on tests.

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

Sidebar

Related Questions

I'm new in unit testing so may be I do something wrong. I have
I am doing unit testing on my iPhone app using OCUnit on XCode 3.2.3,
I use Zend_Test for unit testing in Zend Framework. I have configured the bootstrap
I have read many posts about setting up unit testing in Zend Framework and
I'm leaning toward using MSTest as unit testing framework for a new project but
I'm reading Osherove's The Art of Unit Testing, and though I've not yet seen
Some of us still live in a programming environment where unit testing has not
I have made a project in visual studio and also implemented unit testing. The
When I try to run unit testing on RichDocuments, I get an error: [jd@jd:~/sandbox/trunk/eggs/Products.RichDocument-3.0.2-py2.4.egg/Products/RichDocument/tests]$
I'm new both to Django and unit testing but since I'm starting a project

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.