目前的gcc,还不支持A6的芯片(可惜了我的大iPhone5),等到支持的时候,我会更新本文。
Cydia进入开发者模式,管理=>设置=>开发者,然后在Cydia中搜索并安装OpenSSH,APT 0.6 Transitional
好了,ssh上你的手机,开始安装环境吧。
安装wget,不然没法下载
apt-get install wget |
安装libgcc,不用费心去看是否有新版,就用这个就行。
wget http://apt.saurik.com/debs/libgcc_4.2-20080410-1-6_iphoneos-arm.deb |
dpkg -i libgcc_4.2-20080410-1-6_iphoneos-arm.deb |
安装gcc
apt-get install iphone-gcc |
下载gcc所需的头文件和库并复制到系统目录
wget http://www.syshalt.net/iphone/gcc-iphone/sdk-2.0-headers.tar.gz |
tar -xvzf sdk-2.0-headers.tar.gz |
cd include-2.0-sdk-ready-for-iphone |
cp -r * /usr/include |
cd.. |
wget http://www.syshalt.net/iphone/gcc-iphone/gcc_files.tar.gz |
tar -xvzf gcc_files.tar.gz |
cd gcc_files |
cp -r * /usr/lib |
安装常用命令和库
apt-get install ldid |
apt-get install make |
apt-get install vim |
apt-get install curl |
apt-get install sqlite3 |
这时候就可以写个程序测试下,记得在运行之前执行
ldid –S |
备忘地址
http://code.google.com/p/iphone-gcc-full/issues/detail?id=6
http://iklive.org/cc-compiling-on-ios/
http://stackoverflow.com/questions/14710849/get-gnu-c-compiler-working-on-ios-6-x/