Page 1 of 3 123 LastLast
Results 1 to 10 of 24
Discuss [How-To] Install gcc compile at the iPhone Developer Exchange - Hackint0sh.org; [How-To] Install gcc compiler in iPhone / iPod Touch for firmware 1.1.x You can now ...
  1. #1
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    [How-To] Install gcc compiler in iPhone / iPod Touch for firmware 1.1.x

    You can now install open toolchain headers and gcc compiler for native application in your iPhone/iPod Touch. Although compiling in iPhone/iPod Touch is slow, it is stable and very native.

    If you have ever build the cross compiler from sources in Mac or PC before, you will be happy to see this working development environment in your iPhone/iPod Touch within 10 minutes or so.

    You can follow these steps to have the working gnu gcc compiler, gnu make and the open toolchain header files for 1.1.x :

    Do steps 1 to 3 if you haven't installed Cydia in your iPhone/iPod Touch 1.1.x

    1. Set your iPhone/iPod Auto-Lock to "Never"
    2. Goto Installer and install the package Called Cydia Installer (version 1.0). It will take about 5 minutes to download and install, so you should have connected your iPhone/iPod to Wifi
    3. After installation of Cydia, iPhone/iPod will reboot and you will find a new icon "Cydia" in your Home Screen. Start "Cydia" and it will tell you to update Critical Packages. Follow the instructions to "Update All"
    4. After update of Critical Packages in Cydia, install the following 3 packages
    GNU C Compiler
    Make
    iPhone 1.1.1 Headers

    5. Then you will have the iPhone gcc compiler in your iPhone/iPod now. You can use Mac Terminal or Windows putty to access the terminal of iPhone/iPod via SSH and start building your application.

    To test the installation, you may want to try some HelloWorld example, and here is the attachment that you can try

    copy and unzip it to your iPhone / IPod Touch

    then

    Code:
    cd HelloWorld
    make install
    ./restart
    Then you will have a new native app HelloWorld in Home Screen.

    To uninstall this HelloWorld
    Code:
    cd HelloWorld
    make uninstall

    P.S. There is a nano editor, if you really want to do source editing in Mobile Terminal
    You can also build app in iPhone /iPod Touch in Mobile Terminal as well, see this


    Enjoy!
    Last edited by javacom; 08-16-2008 at 12:37 PM.



  2. #2
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Thumbs up [How-to] Install gcc compiler and build toolchain app for pwned iPhone 2.0.x firmware

    The gcc in iPhone procedure is updated here for the pwned iPhone firmware 2.0/2.0.1

    If you install iPhone GCC, it is important to set root partition to about 700M in pwnage, if you set it too small your will get into trouble whenever there is an upgrade of GCC, as some of the libexec cannot be symlink to second partition.

    You have to install the following packages in Cydia
    • GNU C Compiler
    • iPhone 2.0 Toolchain
    • Make
    • Link Indentity Editor
    • wget (... in order to download the following sample in iPhone)
    • zip (... in order to unzip the following sample in iPhone)


    then download the following zip file in your iPhone to test build your iPhone toolchain app
    Code:
    wget http://www.iphone.org.hk/attach/38270-HelloWorld2.zip
    unzip 38270-HelloWorld2.zip
    Code:
    cd HelloWorld
    make 
    make install
    Restart your springboard, then you will have the HelloWorld app on your springboard

    To uninstall HelloWorld.app
    Code:
    cd HelloWorld 
    make uninstall
    Last edited by javacom; 09-02-2008 at 05:26 AM.
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  3. #3
    Newbie Array

    Join Date
    Jul 2008
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I saw that this post was on the first page and said "huh, some poor sap must've searched like I did and posted in this old thread out of last hope." Glad it's not the case. Thank you very much javacom!

  4. #4
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    Quote Originally Posted by jc4p View Post
    I saw that this post was on the first page and said "huh, some poor sap must've searched like I did and posted in this old thread out of last hope." Glad it's not the case. Thank you very much javacom!
    iPhone GNU C compiler is a great development tool, we have to make good use from it.

  5. #5
    Supporter Array

    Join Date
    Jul 2008
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    iPhone 2.0 Toolchain is a compatibility toolchain so wouldn't it be better to have the real deal, the headers from the 2.0 Apple SDK, and possibily more headers that enable more features that the Apple SDK intentionally left out ?
    And obviously the other question rises, how to get the headers from the Apple SDK working ?


  6. #6
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default

    Quote Originally Posted by adrenalin View Post
    iPhone 2.0 Toolchain is a compatibility toolchain so wouldn't it be better to have the real deal, the headers from the 2.0 Apple SDK, and possibily more headers that enable more features that the Apple SDK intentionally left out ?
    And obviously the other question rises, how to get the headers from the Apple SDK working ?
    There was an iPhone 2.0 header package in Cydia when I first pwned to 2.0. But it isn't there anymore, I guess it was removed.

    But you can still scp your sdk headers from Mac to iPhone Framework folders and also class-dump the private frameworks to get the headers.

  7. #7
    Developer Array javacom's Avatar

    Join Date
    Mar 2008
    Posts
    304
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    28

    Default [How-to] iPhone GCC compile SDK application

    [How-To] copy SDK headers to iPhone and compile SDK applications in iPhone

    Here is the procedure on how to copy the iPhone SDK headers from your mac to iPhone GCC to have a SDK development environment in iPhone

    If you use Linux / Microsoft Windows, see this on how to get the header files from the SDK
    http://www.theiphonewiki.com/wiki/in...=Toolchain_2.0

    Use this shell script in Mac Terminal to copy the installed SDK header files to iPhone directly
    and you have to change IPHONEIP for your actual iPhone IP address
    The script will install the sdk header files to /var/sdk of iPhone

    Code:
    #!/bin/sh
    IPHONEIP=10.0.2.2
    sdkroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks
    sdkframeworks[1]=$sdkroot/AddressBook.framework/Headers/*
    sdkframeworks[2]=$sdkroot/AddressBookUI.framework/Headers/*
    sdkframeworks[3]=$sdkroot/AudioToolbox.framework/Headers/*
    sdkframeworks[4]=$sdkroot/AudioUnit.framework/Headers/*
    sdkframeworks[5]=$sdkroot/CFNetwork.framework/Headers/*
    sdkframeworks[6]=$sdkroot/CoreAudio.framework/Headers/*
    sdkframeworks[7]=$sdkroot/CoreFoundation.framework/Headers/*
    sdkframeworks[8]=$sdkroot/CoreGraphics.framework/Headers/*
    sdkframeworks[9]=$sdkroot/CoreLocation.framework/Headers/*
    sdkframeworks[10]=$sdkroot/Foundation.framework/Headers/*
    sdkframeworks[11]=$sdkroot/MediaPlayer.framework/Headers/*
    sdkframeworks[12]=$sdkroot/OpenAL.framework/Headers/*
    sdkframeworks[13]=$sdkroot/OpenGLES.framework/Headers/*
    sdkframeworks[14]=$sdkroot/QuartzCore.framework/Headers/*
    sdkframeworks[15]=$sdkroot/Security.framework/Headers/*
    sdkframeworks[16]=$sdkroot/SystemConfiguration.framework/Headers/*
    sdkframeworks[17]=$sdkroot/UIKit.framework/Headers/*
    sdkframeworks[18]=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library/Frameworks/IOKit.framework/Headers/*
    iphonesdkroot=/var/sdk
    iphoneframeworksroot=$iphonesdkroot/include
    iphoneframeworks[1]=$iphoneframeworksroot/AddressBook/
    iphoneframeworks[2]=$iphoneframeworksroot/AddressBookUI/
    iphoneframeworks[3]=$iphoneframeworksroot/AudioToolbox/
    iphoneframeworks[4]=$iphoneframeworksroot/AudioUnit/
    iphoneframeworks[5]=$iphoneframeworksroot/CFNetwork/
    iphoneframeworks[6]=$iphoneframeworksroot/CoreAudio/
    iphoneframeworks[7]=$iphoneframeworksroot/CoreFoundation/
    iphoneframeworks[8]=$iphoneframeworksroot/CoreGraphics/
    iphoneframeworks[9]=$iphoneframeworksroot/CoreLocation/
    iphoneframeworks[10]=$iphoneframeworksroot/Foundation/
    iphoneframeworks[11]=$iphoneframeworksroot/MediaPlayer/
    iphoneframeworks[12]=$iphoneframeworksroot/OpenAL/
    iphoneframeworks[13]=$iphoneframeworksroot/OpenGLES/
    iphoneframeworks[14]=$iphoneframeworksroot/QuartzCore/
    iphoneframeworks[15]=$iphoneframeworksroot/Security/
    iphoneframeworks[16]=$iphoneframeworksroot/SystemConfiguration/
    iphoneframeworks[17]=$iphoneframeworksroot/UIKit/
    iphoneframeworks[18]=$iphoneframeworksroot/IOKit/
    
    ssh root@$IPHONEIP "mkdir -p $iphoneframeworksroot"
    scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include root@$IPHONEIP:$iphonesdkroot
    scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib root@$IPHONEIP:$iphonesdkroot
    
    for index in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
    do
      echo "copying ${sdkframeworks[index]} to ${iphoneframeworks[index]}"
      ssh root@$IPHONEIP "mkdir -p ${iphoneframeworks[index]}"
      scp -r ${sdkframeworks[index]} root@$IPHONEIP:${iphoneframeworks[index]}
    done
    In order to avoid typing the password using ssh, you can install the ssh public key of your Mac to your iPhone using the following method

    (a) keygen in Mac terminal and type (if you haven't generated it before)
    Code:
    ssh-keygen -t rsa
    (b) create .ssh directory in iPhone (assume ip address of iPhone is 10.0.2.2) and in Mac terminal and type
    Code:
    ssh root@10.0.2.2 'mkdir -p .ssh'
    then enter iPhone root password (alpine)

    (c) copy mac public key to iPhone, and in Mac Terminal type
    Code:
    cat ~/.ssh/id_rsa.pub | ssh root@10.0.2.2 'cat >> .ssh/authorized_keys'
    then enter iPhone root password (alpine)

    (d) Edit the file /etc/ssh/sshd_config in iPhone

    change these
    Code:
    #StrictModes yes
    #PubkeyAuthentication yes 
    #AuthorizedKeysFile      .ssh/authorized_keys
    to

    Code:
     
    StrictModes no 
    PubkeyAuthentication yes 
    AuthorizedKeysFile      .ssh/authorized_keys
    (e)reboot iPhone


    Here is the project folder to test your SDK headers installation in iPhone.

    I have successfully compiled a modified SDK sample app (modified to non-Interface Builder verison) UICatalog

    (i) copy it (using wget) and unzip it in iPhone
    Code:
    wget http://www.iphone.org.hk/attach/39773-UICatalog.zip  
    unzip 39773-UICatalog.zip
    (ii) then run
    Code:
    cd UICatalog 
    make install
    to build and install the SDK project in iPhone

    After SpringBoard restart, test the UICatalog app in iPhone.
    Last edited by javacom; 09-02-2008 at 05:26 AM.
    Touch Dial is an easy-to-use application for one touch dial / sms icon on the home screen for iPhone.

    This app can read the accelerometer and do phone dial or SMS dial for the same number based on the your setting for Portrait or Landscape Mode of iPhone.


  8. #8
    Newbie Array

    Join Date
    Jul 2008
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I gotta say, you're a great man. Thank you very much yet again.

  9. #9
    Rookie Array

    Join Date
    Aug 2008
    Posts
    12
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I managed to get the SDK on the phone to use the gcc compiler. One thing to note was that stdint.h was missing. Just took the one from the toolchain port found in cydia.

  10. #10
    Newbie Array

    Join Date
    Aug 2008
    Posts
    4
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Thanks, this has been a lot of help.


 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. compile webcore on mac
    By mhu in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 08-23-2012, 12:19 AM
  2. Compile iRecovery
    By sailor0703 in forum Tools
    Replies: 1
    Last Post: 09-27-2010, 10:57 PM
  3. UIWebView? Does it compile for you?
    By wififun in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 08-27-2007, 04:07 AM
  4. compile?
    By kdbdallas in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 08-09-2007, 04:02 AM
  5. Compile iphoneinterface on a Mac
    By amb1s1 in forum General
    Replies: 0
    Last Post: 07-10-2007, 02:12 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 01:28 PM.
twitter, follow us!