`
mrjeye
  • 浏览: 176608 次
  • 性别: 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/
分享到:
评论

相关推荐

    ios_gcc配置文件

    ios_gcc教程需要用到的配置文件,涉及到的编程语言有C/C++/OC/Bash/Java/Python,另外包含MySQL数据库的安装、配置与开发,配置好Theos之后可以直接在iOS设备上进行iOS SDK图形界面应用程序开发。

    iPhonetoolchain4.0(Ubuntu10.10开发环境)推荐.pdf

    以下是安装gcc-4.4的命令: 1. `sudo apt-get install gcc-4.4 g++-4.4 gobjc-4.4` 2. `sudo update-alternatives --remove-all gcc` 3. `sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 ...

    [修复下载链接]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_...

    iphone linux

    7. **开发工具**:对于开发者来说,使用iPhone Linux可能涉及到学习如何在iOS设备上调试和测试Linux应用程序,这可能需要用到GDB、GCC等开发工具。 8. **社区支持**:越狱和Linux社区为这些项目提供了大量的资源,...

    about iphone SDK.pdf

    本文档旨在介绍 iPhone SDK 的更新内容、兼容性、安装指南以及其主要特性。 #### 兼容性与系统要求 iPhone SDK 需要在运行 macOS Leopard 版本 10.5.4 或更高版本的 Intel 架构 Mac 上运行。对于仅针对 Mac 开发的...

    iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__read_me.pdf

    这份文档详细介绍了Xcode 3.2.1与iPhone SDK 3.1.3的兼容性、新功能、安装流程以及重要通知。 ### 兼容性 此软件包仅支持基于Intel处理器的Mac电脑,并且要求操作系统版本为Mac OS X Snow Leopard 10.6.0或更高...

    rpm格式的gcc源码

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

    Modbus-RTU_gcc-linaro-_sqlite_

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

    OpenSSL-for-iPhone-master.zip_OpenSSL-for-iPhone_openssl_openssl

    2. **准备编译环境**:确保你已经安装了Xcode和Command Line Tools,这些工具包含了编译所需的gcc或clang编译器,以及make等构建工具。 3. **配置编译选项**:使用`Configure`脚本来配置OpenSSL,以适应iOS的多种...

    iphone开发环境 windows篇之 cygwin + toolschain

    1. **下载和安装Cygwin**:访问Cygwin官方网站,选择镜像站点,然后通过安装程序选择你需要的开发工具,包括gcc,make,autoconf等。 2. **获取iPhone Toolchain**:找到支持Windows的iPhone Toolchain,这通常包括...

    iPhone在CYGWIN下开发介绍

    然后,使用CYGWIN中的Xcode命令行工具(如`xcodebuild`)或者GCC编译器进行编译。编译完成后,产生的可执行文件可以进一步通过iTunes同步到iPhone设备上进行测试和运行。 要注意的是,尽管CYGWIN提供了便利,但在...

    Windows平台上iPhone基于cygwin开发环境的搭建方法

    下载并安装Xcode后,找到包含iOS SDK的目录,通常是`/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/`。 现在,你需要配置Cygwin使其能够与iOS SDK交互。这涉及到创建软...

    busybox ios版

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

    iPhone开发入门[归纳].pdf

    - Xcode集成了GCC和GDB等开源工具,用于编译和调试,同时支持版本控制系统如Subversion和CVS,方便团队协作。 4. **优化性能**: - 对于iPhone应用,性能优化至关重要,因为内存和电池寿命有限。Xcode提供的...

    iphone开发初探

    Xcode作为主要的iPhone开发集成环境,使用GCC作为编译器。 2. 与C/C++的`#include`不同,Objective-C使用`#import`来导入头文件,避免了头文件的重复导入。 3. `NSLog()`是推荐的日志输出函数,它会在文本后自动添加...

Global site tag (gtag.js) - Google Analytics