◇ 哎.瘋.人.網 ◇網站現已遷移至新的版面 Apple.ORG.HK Apple人網



 ◇ 哎.瘋.人.網 ◇  Development◇哎瘋程式搞作◇  

顯示適合列印的版本 顯示適合列印的版本  把這個主題寄給朋友 寄給朋友
按平行模式觀看按樹型模式觀看前一篇主題后一篇主題
作者 �駷How-To] Install gcc compiler & header files in iPhone
javacom




版主

文章: 3083
于 2008-06-28 15:03  觀看該用戶的個人資料  搜尋這個用戶發表的所有文章  把文章內容复制到剪貼板。
只适用于 IE :-)
Cydia is a new package management replacement to the existing Installer.app that we are using. And it now also brings you the full power of development tools in iPhone.

Cydia might not be good for nomal packages that you could get from Installer.app But you could certainly get something that Installer.app can't give you. And this is great for developer.

You can now install open toolchain headers and gcc compiler in your iPhone. Although it is slow to compile in iPhone but it is stable and very native.

If you have ever build the cross compiler from sources before, you will love to see this working in your iPhone within 10 minutes or so.

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

1. Set your iPhone Auto-Lock to "Never"
2. Goto Installer and install the package Called Cydia Installer (version 1.0). It will take some time to download and install, so you should have connected your iPhone to Wifi
3. After installation of Cydia, iPhone 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 can have gcc compiler in your iPhone now. You can use Mac Terminal or putty to access the terminal of iPhone and start building your application.

Please take note that after the installation of Cydia, your BSD subsystem is now changed to Fake BSD subsystem and also fixed a number of bugs. So don't update BSD subsystem from the Installer.app

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
then
 
cd HelloWorld
make install
./restart

Then you will have a new program HelloWorld.

To uninstall this HelloWorld
 
cd HelloWorld
make uninstall




Enjoy!


31847-HelloWorld.zip


javacom 修改于 2009-01-05 21:53

http://www.cnepub.com/discuz/?fromuid=47472

香港交通快拍 v1.1 Preview
http://hk.youtube.com/watch?v=1BHvTC5-QTc

開啟隱藏的表情符號,不用 jailbreak



iPhone 3G ◇哎瘋生滋◇ 常見問題集
javacom




版主

文章: 3083
于 2008-08-16 18:04  觀看該用戶的個人資料  搜尋這個用戶發表的所有文章  把文章內容复制到剪貼板。
只适用于 IE :-)
The gcc compiler procedure is updated here for the pwned iPhone firmware 2.0.x

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
 
wget http://www.iphone.org.hk/attach/38270-HelloWorld2.zip
unzip 38270-HelloWorld2.zip


 
cd HelloWorld
make
make install


Restart your springboard, then you will have the HelloWorld app on your springboard

To uninstall HelloWorld.app
 
cd HelloWorld
make uninstall



38270-HelloWorld.zip


javacom 修改于 2008-10-01 19:12

http://www.cnepub.com/discuz/?fromuid=47472

香港交通快拍 v1.1 Preview
http://hk.youtube.com/watch?v=1BHvTC5-QTc

開啟隱藏的表情符號,不用 jailbreak



iPhone 3G ◇哎瘋生滋◇ 常見問題集
javacom




版主

文章: 3083
于 2008-08-27 14:09  觀看該用戶的個人資料  搜尋這個用戶發表的所有文章  把文章內容复制到剪貼板。
只适用于 IE :-)
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

I have installed the sdk header files to /var/sdk of iPhone

If you use Linux / Microsoft Windows, see this on how to get the header files from the SDK

http://www.theiphonewiki.com/wiki/index.php?title=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
 
#!/bin/sh
IPHONEIP=10.0.2.2
#this is for sdk 2.0
#SDKVER=2.0
#and this is for sdk 2.1
SDKVER=2.1
sdkroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.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/iPhoneSimulator${SDKVER}.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/iPhoneOS${SDKVER}.sdk/usr/include root@$IPHONEIP:$iphonesdkroot
scp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDKVER}.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)
ssh-keygen -t rsa


(b) create .ssh directory in iPhone (assume ip address of iPhone is 10.0.2.2)
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
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
 
#StrictModes yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys


to

  
StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys


(e)reboot iPhone

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

Here is the project folder to test your installation.

(i) copy it (using wget) and unzip it in iPhone
wget http://www.iphone.org.hk/attach/39773-UICatalog.zip    
unzip 39773-UICatalog.zip


(ii) then run
cd UICatalog  
make
make install


to build and install the project in iPhone


39773-UICatalog.zip


javacom 修改于 2008-10-01 19:12

http://www.cnepub.com/discuz/?fromuid=47472

香港交通快拍 v1.1 Preview
http://hk.youtube.com/watch?v=1BHvTC5-QTc

開啟隱藏的表情符號,不用 jailbreak



iPhone 3G ◇哎瘋生滋◇ 常見問題集

 ◇ 哎.瘋.人.網 ◇  Development◇哎瘋程式搞作◇  

顯示適合列印的版本 顯示適合列印的版本  把這個主題寄給朋友 寄給朋友
按平行模式觀看按樹型模式觀看前一篇主題后一篇主題
  看過的文章
  新的文章
  被刪除的文章
跳轉到

發表新的文章回覆主題


[錯誤信息]
Table './iphone1/ut_online' is marked as crashed and should be repaired

請通知討論區管理員 <kk@hkfoot.com>。