`
mrjeye
  • 浏览: 174169 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

iPhone安装gcc

阅读更多
I search a lot on internet how to do this, and I found some info from Anastas Stoyanovsky. Most people posted that if you install libgcc on iOS 4 it will crash at boot but this is not true.

Here is what you need to do in order to be able to compile and run a C application on iphone:

    1. You will need to Jailbreak the iPhone first, search on google for more info.
    2. Install OpenSSH from Cydia.
    3. Connect iPhone to your wireless network and SSH to it.
    4. Download this application using: wget http://www.syshalt.net/pub/iphone/gcc-iphone/fake-libgcc_1.0_iphoneos-arm.deb
    5. Install libcc using: dpkg –i fake-libgcc_1.0_iphoneos-arm.deb
    6. Install iphone-gcc using this command: apt-get install iphone-gcc
    (you can download this version from my website: iphone-gcc if does not work on your device the one that is installed by default)
    7. Download using: wget http://www.syshalt.net/iphone/gcc-iphone/sdk-2.0-headers.tar.gz
    8. Untar with command: tar -xvzf sdk-2.0-headers.tar.gz
    9. Enter in the new created folder with: cd include-2.0-sdk-ready-for-iphone
    10. Copy all files to include folder with command: cp –r * /usr/include
    11. Now type: cd .. in order to return to the previous folder
    12. Download using: wget http://www.syshalt.net/iphone/gcc-iphone/gcc_files.tar.gz
    13. Untar with command: tar -xvzf gcc_files.tar.gz
    14. Enter in the new created folder with command: cd gcc_files
    15. Copy all files to /usr/lib using command: cp –r * /usr/lib
    16. Install ldid to sign the application (this will prevent iOS to kill the application at startup) using: apt-get install ldid
    17. Sign your compilet aplication using: ldid –S <application>
    18. Run the application using: ./<application>

    Suggestion: Install using: apt-get install nano
    This will help you code easy directly from terminal.

Here is an example of hello world using C and gcc to compile on iPhone iOS 4:

I used nano hello.c in terminal to open a new files and writed this simple application:

#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}

and then CTRL+X to save it, then I typed: gcc –o hello hello.c and after that ldid –S hello
Now you can run your application using ./hello


FROM:http://blog.syshalt.net/index.php/2010/09/12/compile-c-applications-with-gcc-on-ios-4-iphone/
分享到:
评论

相关推荐

    [修复下载链接]iPhone5S和iPad4上编译C/C++

    如果曾经安装 iphone-gcc, perl … 包,请先卸载 apt-get remove apt-get remove iphone-gcc odcctools apt-get remove perl net.howett.theos (3) 解压及安装 安装deb cd /var/root/ tar xzvf iphonedev_v3_...

    rpm格式的gcc源码

    对不起 这个不完整 别下载了 见谅 见谅啊。

    Modbus-RTU_gcc-linaro-_sqlite_

    在windows上大家可以使用iTunes来与iPhone进行通信,但是Linux上没有这类的官方软件,所以一些爱好者就破解了iTunes的通信协议,然后在Linux上实现了该协议,也就是libimobiledevice啦

    busybox ios版

    busybox ios版 iphone-gcc编译 armv6指令 mac OSX 10.5以上系统使用。 arm版本Mach-O格式的busybox可执行文件 BusyBox v1.20.0版本

    ffmpeg移植到IOS上 Demo

    --as='/usr/local/bin/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \ --sysroot=/Applications/Xcode.app/Contents/Developer/...

    iPhone-rootFS-tool:我开发了一个小实用程序,用于将rootfs从越狱设备转储到Mac,以备法医检查

    iPhone-RootFS工具 这个工具有什么作用? iPhone-rootFS-Tool会将iOS设备根目录的所有目录和文件传输到您的计算机。 这可能发生在您的iOS设备首次解锁(BFU)之前...运行: gcc main.c iLibX.c -o iPhone-rootFS-tool

    Objective-C.程序设计(第4版)扫描版带书签

    它基于C语言设计而成,是一种面向对象编程语言,功能非常强大,广泛用于OS X以及多种支持gcc编译器的操作系统,如LINUX、UNIX和Windows系统。 本书是一本权威的Objective-C 2.0参考书,详细介绍该语言的具体内容。...

    ipad_charge:在 Ubuntu Linux 下为 Apple 设备充电

    支持的设备: iPad iPad2 iPad3 iPad4 小型平板电脑iPad Air iPad 迷你 2 iPad Air 2 iPad 迷你 3 iPad 迷你 4 iPad 5 iPad 6 iPad Air 3 iPad 迷你 5 iPad 7 iPod 触摸 2G iPod 触摸 3G iPod 触摸 4G iPhone 3GS ...

    8.4.1脱网(适用于32位iOS)-C/C++开发

    daibutsu 8.4.1 undether(对于32位iOS)漏洞利用覆盖libmis.dylib中的...(源代码仍仅适用于iPhone5,2-12H321)build &&运行gcc haxx.c -o haxx ./haxx dyld_shared_cache_armv7s dyld_shared_cache_armv7s_hack他

    nginx-mobile-resize-conf:使用这个 nginx 配置,我们可以检查用户设备的类型(iPhone、iPod、iPad、Android 手机、Android 平板电脑),按比例增加请求图像的大小并缓存它

    关于使用这个 nginx 配置,我们可以检查用户设备的类型(iPhone、iPod、iPad、Android 手机、Android 平板电脑),检测请求图像的原始大小,按比例增加该图像,缓存它并返回给客户端。nginx 的依赖ngx_...

    Objective-C中文.part2

    Objective-C可以在gcc運作的系統寫和編譯,因為gcc含Objective-C的編譯器。 Objective-C是非常「實際」的語言。它使用一個用C寫成、很小的运行库,只會令應用程式的大小增加很小,和大部分OO系統使用極大的VM執行...

    objective-c中文版.part1

    Objective-C可以在gcc運作的系統寫和編譯,因為gcc含Objective-C的編譯器。 Objective-C是非常「實際」的語言。它使用一個用C寫成、很小的运行库,只會令應用程式的大小增加很小,和大部分OO系統使用極大的VM執行...

    Clang GNUstep Objective C for Windows

    可以使用GNUstep在Windows XP上寫Objective-C程式,但是Objective-C已經加了很多新東西,而GNUstep裡的gcc並不提供,所以,这个是GNUstep,再加上新一代的編譯器架構Clang與LLVM(這也是Apple在新版Xcode裡預設使用...

    object c 编程

    免麻烦,而且万一有一天 gcc 把它拿掉了,将会有足够的 Objective-C 程序员 可以坚持保留它或是将它放回来。偷偷告诉你,Apple 在它们官方的程序代 码中也使用了 #import。所以万一有一天这种事真的发生,不难预料 ...

    Libraries-OLD:带有构建脚本的OS X和iOS的各种预编译开源库

    建造要(重新)构建OS X,iPhone Simulator和iPhone OS的所有库,只需在终端的“ Build-Scripts”目录中运行“ build-all.sh”命令。 在OS X 10.9和Xcode 5.0.1上测试了构建脚本。 使用要在OS X或iOS Xcode项目中...

    word源码java-DeviceInternet:设备互联网

    word源码java #目标 DeviceConnect是手机控制ARM板子上的外设的最简单实例,目标是让使用者能更方便的扩张。...device目录,ARM工控板的程序源码,C语言程序,gcc交叉编译器编译后在ARM板子上运行。 ios目录,iPhone

    bgfx:与跨平台的图形API无关,“自带EngineFramework”样式呈现库

    支持平台: Android(14 +,ARM,x86,MIPS) asm.js / Emscripten(1.25.0) FreeBSD iOS(iPhone,iPad,AppleTV) Linux MIPS Creator CI20 OSX(10.12+) 的PlayStation 4 树莓派Windows(XP,Vista,7、8、10)...

Global site tag (gtag.js) - Google Analytics