title: Multiple Targets in Xcode: "Failed to launch simulated application: Unknown error."
body: <p>I'm trying to build for multiple targets in Xcode, to simplify the process of creating a "lite" and "pro" version of my application.  In theory, this is great and I can pass defines to <code>GCC_PREPROCESSOR_DEFINITIONS</code> for use in my code.  However, I'm having problems actually getting it to work due to an error trying to launch the second target in the simulator: <code>Failed to launch simulated application: Unknown error.</code></p>
  
  <p>Here is the simple process I'm using to create the additional target:</p>
  
  <ol>
  <li>Add #ifdef MYAPP_PRO to source files to modify behavior based on pro/lite version of app (and verify application is working as expected)</li>
  <li>Select <code>Project</code> > <code>New Target...</code> from menu, and pick "Cocoa Touch Application" (named MyAppPro")</li>
  <li>Edit new target settings; add <code>GCC_PREPROCESSOR_DEFINITIONS</code> user-defined setting and set the value to "MYAPP_PRO" (no quotes)</li>
  <li>Set active target to "MyAppPro"; build and run.</li>
  <li><code>Failed to launch simulated application: Unknown error.</code></li>
  <li>Copy all settings from Info.plist to MyAppPro-Info.plist and try again</li>
  <li><code>Failed to launch simulated application: Unknown error.</code></li>
  </ol>
  
  <p>The build completes just fine, but I'm unable to run in simulator.</p>
  
  <p>Editing the project.pbxproj in the .xcodeproj directory, I notice there are some key differences between the two target definitions' build settings.  I tried manually editing the file but must have done something wrong because I couldn't get it to load in Xcode afterwards.</p>
  
  <p>Original target's "Debug" build settings:</p>
  
  <pre><code>        buildSettings = {
              ALWAYS_SEARCH_USER_PATHS = YES;
              ARCHS = "$(ARCHS_STANDARD_32_BIT)";
              "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
              GCC_C_LANGUAGE_STANDARD = c99;
              GCC_WARN_ABOUT_RETURN_TYPE = YES;
              GCC_WARN_UNUSED_VARIABLE = YES;
              ONLY_ACTIVE_ARCH = YES;
              PREBINDING = NO;
              SDKROOT = iphoneos2.2.1;
          };
  </code></pre>
  
  <p>Thew new MyAppPro target's "Debug" build settings:</p>
  
  <pre><code>        buildSettings = {
              ALWAYS_SEARCH_USER_PATHS = NO;
              CODE_SIGN_IDENTITY = "iPhone Developer";
              COPY_PHASE_STRIP = NO;
              GCC_DYNAMIC_NO_PIC = NO;
              GCC_OPTIMIZATION_LEVEL = 0;
              GCC_PRECOMPILE_PREFIX_HEADER = YES;
              GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h";
              INFOPLIST_FILE = "MyAppPro-Info.plist";
              INSTALL_PATH = "$(HOME)/Applications";
              OTHER_LDFLAGS = (
                  "-framework",
                  Foundation,
                  "-framework",
                  UIKit,
              );
              PREBINDING = NO;
              PRODUCT_NAME = MyAppPro;
              SDKROOT = iphoneos2.2.1;
          };
  </code></pre>