Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can do this, but it requires some minor Xcode hacking, and some sacrifices. Depending on what you mean by <em>"support iOS 6"</em>, this may or may not be sufficient for you. If you just want your app to run on iOS 6, then this should work. If you also need your app to incorporate new iOS 6 features, then it won't.</p> <p>&nbsp; &nbsp; <em>(Note for others who don't have a problem using multiple versions of Xcode: <a href="https://stackoverflow.com/q/12619124/119114">this similar question</a> has answers that do allow you to also use new iOS 6 APIs and directly target armv7s)</em></p> <p><a href="http://blog.chpwn.com/post/31824877081" rel="nofollow noreferrer">See basic instructions on chpwn's blog here</a> (but read the rest of this below, too!)</p> <p>Basically, you can use Xcode 4.5 to build for iOS 4 and above, but then you can't take advantage of the new iOS 6 only features. So, you're really building for iOS 4 and 5, and assuming that the app will run fine on iOS 6 (which should be true, but you'll need to test this yourself).</p> <p>You'll need to copy the iOS 5 SDK folder </p> <pre><code>/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.*.sdk </code></pre> <p>from an old Xcode installation (which you'll need to keep around briefly, or reinstall to a non-standard location). You'll then set the <strong>Deploy Target</strong> in your Build Settings to iOS 4.0 (or whatever minimum OS you want). You may need to open the <code>project.pbxproj</code> file in a text editor to set this manually:</p> <pre><code>IPHONEOS_DEPLOYMENT_TARGET = 4.0; </code></pre> <p>You'll also need to set the Architectures to <code>armv6</code> and <code>armv7</code>. You cannot directly <strong>also</strong> target <code>armv7s</code>. But, that doesn't mean your app won't run on iPhone 5. <code>armv7</code> executables should run on iPhone 5, simply without any optimizations added in <code>armv7s</code>. It's just that compatibility doesn't work in the other direction (e.g. <code>armv7</code> executables don't run on an <code>armv6</code> iPhone 3G).</p> <p><img src="https://i.stack.imgur.com/rupFK.png" alt="enter image description here"></p> <p>There's also a step that might be necessary, that's <strong>not</strong> mentioned in chpwn's blog. You may get these warnings (which really are errors, because Xcode won't generate your executable properly):</p> <blockquote> <p>warning: no rule to process file '$(PROJECT_DIR)/main.m' of type sourcecode.c.objc for architecture armv6</p> </blockquote> <p>In order to fix this, you'll need to setup a custom <strong>Build Rule</strong> for your target that tells Xcode to use <strong>LLVM GCC 4.2</strong> to generate armv6 code. Define the rule for files matching the pattern <code>*.[mc]</code>:</p> <p><img src="https://i.stack.imgur.com/7HnGW.png" alt="enter image description here"></p> <p>This will be a different compiler than the Xcode default, and you may need to adjust some of the syntax in your Objective-C code. Even though many people wanting to do this probably wrote their apps before ARC, it is important to note that <a href="https://stackoverflow.com/a/10769741/119114">LLVM gcc 4.2 does not support ARC</a>.</p> <p>Finally, you probably will still see warnings from Xcode about iOS deploy targets less than 4.3, and <code>armv6</code> not being supported. Those, I found, were not problems, and could be ignored:</p> <p><img src="https://i.stack.imgur.com/O6UIQ.png" alt="enter image description here"></p> <p>Running <code>lipo -info</code> on my app executable after this shows the desired result:</p> <pre class="lang-bsh prettyprint-override"><code>lipo -info MyAppName Architectures in the fat file: MyAppName are: armv6 armv7 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload