<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Chris Hardie &#187; programming</title>
	<atom:link href="http://www.chrishardie.com/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrishardie.com</link>
	<description>Personal Website and Blog for James Christopher Hardie</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:29:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Using the iPhoneOS SDK on older PPC Macs</title>
		<link>http://www.chrishardie.com/2009/01/using-the-iphoneos-sdk-on-older-ppc-macs/</link>
		<comments>http://www.chrishardie.com/2009/01/using-the-iphoneos-sdk-on-older-ppc-macs/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 19:25:58 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.chrishardie.com/?p=503</guid>
		<description><![CDATA[I&#8217;m just getting started with developing applications for the iPhone / iPod Touch, and one of the first real hurdles I encountered was that Apple didn&#8217;t make it easy by default to use their iPhoneOS SDK on non-Intel Macs. With some Googling around I was was able to find a variety of articles that mentioned [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m just getting started with developing applications for the iPhone / iPod Touch, and one of the first real hurdles I encountered was that Apple didn&#8217;t make it easy by default to use their iPhoneOS SDK on non-Intel Macs.  With some Googling around I was was able to find a variety of articles that mentioned workarounds, but the comprehensive solution was spread across lots of blog post comments, forum postings, etc.  So, for my own reference and hopefully as assistance to anyone else who might be in the same boat, I&#8217;m consolidating the steps here.</p>
<p><span id="more-503"></span>I&#8217;m using a 1.5GHz Powerbook G4, which uses the PowerPC (PPC) architecture.  I downloaded version 2.2 of the iPhoneOS SDK, build 9m2621-final.</p>
<p>After the regular installation of the <a href="http://developer.apple.com/iphone/">iPhoneOS SDK</a> (which is really just the regular Xcode install with some additional packages thrown in) was complete, the Xcode new project menu was notably missing the option to choose the iPhone platform.  On the advice of <a href="http://3by9.com/85/dont-have-an-intel-machine-but-want-to-code-for-the-iphone-anyway-follow-these-steps/">this 3by9 article</a>, I took these steps:</p>
<ol>
<li>Mount the SDK installer disk image</li>
<li>Open the packages folder</li>
<li>One at a time, install all of the .pkg files that begin with &#8220;iPhone&#8221;, using the default install destination</li>
<li>When done, you&#8217;ll have a &#8220;Platforms&#8221; directory in the root level of your Mac&#8217;s hard drive.  Move the contents of that directory into the <code>/Developer/Platforms/</code> directory.  If you&#8217;re like me, when you&#8217;re done, you&#8217;ll have three directories in <code>/Developer/Platforms</code>: &#8220;iPhoneOS.platform&#8221;, &#8220;iPhoneSimulator.platform&#8221; and &#8220;MacOSX.platform&#8221;.</li>
</ol>
<p>Once that step is done, you&#8217;ll be able to launch Xcode and create new projects that use the iPhoneOS platform and application types.  But, you still won&#8217;t be able to build or run those applications, because Apple has hardcoded the &#8220;i386&#8243; (Intel) architecture as the only valid one to compile for.  Thanks to a variety of comments on the above 3by9 post and comments 23-25 on <a href="http://www.tuaw.com/2008/03/27/iphone-sdk-beta-2-now-hitting-the-streets/2#comments">this TUAW article</a>, here are the remaining steps to address that:</p>
<ul>
<li>Close Xcode and edit this file (perhaps after making a backup): <code>/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/iPhone Simulator Architectures.xcspec</code></li>
<li>Change line 12 to read <code>Name = "Standard (iPhone Simulator: i386 ppc)";</code></li>
<li>Change line 16 to read <code>RealArchitectures = ( i386, ppc );</code></li>
<li>Add this chunk before the last closing parentheses:
<div class="wp_syntax">
<div class="code">
<pre class="objective_c" style="font-family:monospace;">     // PowerPC
     {
          Type = Architecture;
          Identifier = ppc;
          Name = &quot;PowerPC&quot;;
          Description = &quot;32-bit PowerPC&quot;;
          PerArchBuildSettingName = &quot;PowerPC&quot;;
          ByteOrder = big;
          ListInEnum = NO;
          SortNumber = 106;
     },</pre>
</div>
</div>
</li>
<li>Save the file and close it.  Now relaunch Xcode.</li>
<li>With Xcode open and your project loaded, right click on the project name under the &#8220;Groups &amp; Files&#8221;, and select &#8220;Get Info&#8221;</li>
<li>Under the &#8220;Build&#8221; tab and in the &#8220;Architectures&#8221; menu, change these options:<br />
Set <code>Architectures</code> to &#8220;Native Architecture of Build Machine&#8221;<br />
Set <code>Base SDK</code> to &#8220;Simulator &#8211; iPhoneOS 2.2&#8243;<br />
Leave <code>Build Active Architecture Only</code> checked<br />
Edit <code>Valid Architectures</code> to be not only include armv6, but also &#8220;ppc&#8221; and &#8220;i386&#8243;.<br />
(I think some of these may be redundant, but it&#8217;s the combination that&#8217;s working for me.)</li>
</ul>
<p>When you next build your project, you shouldn&#8217;t get any errors about <code>VALID_ARCHS</code>.</p>
<p>I hope that&#8217;s helpful.  Since this is only one particular combination of build hardware/architecture and SDK software version, I&#8217;m sure there are other combinations out there where the above may not work, your mileage may vary.</p>
<p>Now, back to working on building an actual application&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrishardie.com/2009/01/using-the-iphoneos-sdk-on-older-ppc-macs/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>

