<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d6154817622702903944\x26blogName\x3d%E2%97%8B%E3%80%82o%E5%82%BB%E3%80%83%E4%BB%94%E3%80%83%E4%BB%94o%E3%80%82\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://vincent1303.blogspot.com/search\x26blogLocale\x3dzh_TW\x26v\x3d2\x26homepageUrl\x3dhttp://vincent1303.blogspot.com/\x26vt\x3d682101390609131817', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

iPhone SDK 2.0 in Linux


The building of iPhone gcc in Linux is described in
http://www.saurik.com/id/4

But this guide involved a lot of downloading and patching, so I put all the downloading in one zipped tar file. All you have to do is download it and run the build script in your Linux

I used the Asus eeepc Linux as an example, but others Linux variant / cygwin should be very similar.

Asus eeepc comes with xandros Debian Linux but does not have development tools. This part(A) shows you how to setup the development tools first. Other Linux variant does have development tools and you might want to skip this part and continue on Part B

(A) Install the development tools in eeepc

(1) Launch Terminal (Ctrl-Alt-T) in eeepc

(2) edit the file/etc/apt/sources.list
  sudo vi /etc/apt/sources.list


and add this line to the end of the file "sources.list"
deb http://http.us.debian.org/debian/   stable main


(3) Run these commands in Terminal to install building tools

 
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential bison flex


(B) Download the file to your Linux
UpgradeToolChain2.tgz

The package is very large (about 200M)
You should first goto this websever
http://www.iphonefix.de/

and click the download menu
and username password is generated for every visitor on the fly when you click on the ftp sever link

Inside the ftp server goto the folder
iPhoneToolchain VMWare Image / V3
and download the file UpgradeToolChain2.tgz



MD5 (UpgradeToolChain2.tgz) = b373c0e600d45b1019e2894614b5979b
Size (UpgradeToolChain2.tgz) = 202278454

and extract to /usr
 
cd /usr
sudo tar -xzvf ~/UpgradeToolChain2.tgz


(C) login in as superuser and build the Darwin CC tools and llvm-gcc in Linux
  
su
cd /usr/toolchain2
./build_20.sh

wait for 10 to 20 minutes to complete the buiding of tools and gcc

If you extract the tgz to different folder and want to build it in some other folder, please modify the environment variable toolchain in build_20.sh

(D) Test build your project in Linux
The include files have the iPhone SDK headers so you can test it using some available open source project (without Interface Builder) that using SDK 2.0 headers

For example, download this WinterBoard App Source code from the developer and compile it in Linux
 
wget http://svn.saurik.com/repos/menes/trunk/winterboard/Application.mm

/usr/toolchain2/pre/bin/arm-apple-darwin9-g++ -g0 -O2 -Wall -Werror -o WinterBoard Application.mm \
-framework UIKit -framework Foundation -framework CoreFoundation -lobjc -framework CoreGraphics


If you want to deploy the app to iPhone, you have to codesign it (using ldid in iPhone) and provide the additional required project file in the .app folder e.g. (Info.plist, Icon.png etc)

Enjoy compiling and building iPhone App

Moreover, I have modified a previous VMWare image based on Debian Linux and build the llvm-gcc for iPhone and the toolchain and SDK20 headers there. If you have VMWare workstation or player / VMWare Fusion (Mac OS X), you can use it to build 2.0 iPhone app using ssh or samba mount access. The VMWare image is very large (1.2G compressed).

You should first goto this websever
http://www.iphonefix.de/

and click the download menu
and username password is generated for every visitor on the fly when you click on the ftp sever link

Inside the ftp server goto the folder
iPhoneToolchain VMWare Image / V3
and download the file
iPhoneToolchian_SDK20.rar



MD5 (iPhoneToolchain_SDK20.rar) = 29888ad8a73cf0a9674152c64961c02a
Size (iPhoneToolchain_SDK20.rar) = 1304054096

unrar the file and then use VMWare workstation or VMWare Fusion to open it

login: root
password: toolchain

The instructions are in the README.txt

There are 3 sample projects inside the VMWare image

Source : http://www.iphone.org.hk/cgi-bin/ch/topic_show.cgi?id=9359

Link from

“ iPhone SDK 2.0 in Linux ”