[How-To] Install iPhone SDK 2.0 in Linux

Discussion in 'iOS Development' started by MrFairladyz, Feb 14, 2009.

  1. MrFairladyz

    MrFairladyz Active Member

    Mar 2, 2008
    Likes Received:
    iPod touch
    note- This is not my article. original is here try this at your own risk, i wont be providing any help. if you have ubuntu, skip to part b (ubuntu and some others already come with dev tools)

    [How-To] Install llvm-gcc for iPhone SDK 2.0 in Linux

    The building of iPhone gcc in Linux is described in

    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

    The package is very large (about 200M)
    You should first goto this websever

    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

    Please Register or Log in to view images

    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

     cd /usr/toolchain2 

    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


    EDIT: i did everything above, but cant get the app to run... any ideas?

Share This Page