All further instructions assumes that you have already did your jailbroke(blackra1n,redsn0w - no matter)
Let's try with full weight iPhone application!
- Run cydia
- Install openSSH to be able to connect to your phone
- Install apt 0.7 strict - you will need this package handling utility to install additional libraries without using cydia.
- Connect to your phone via ssh(default password will be "alpine" without quotes)
Example:
$ ssh root@192.168.1.104
- Install essentials
# apt-get install wget
# apt-get install vim - You will need libgcc(Thank you Saurik!)
# cd /tmp
# wget -c "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 - Now it is toolchain's turn
apt-get install com.bigboss.20toolchain
# vim main.cExample:
#include <stdio.h> int main() {Compile:
printf("Hello world!"); return 0;}
gcc main.c -o mainOutput:
ld: library not found for -lSystem collect2: ld returned 1 exit statusTo get this step done you should copy {libobjc.dylib,libSystem.dylib} files from official iPhone SDK. Put these files into /usr/lib and create links to them.
ln /usr/lib/libSystem.B.dylib /usr/lib/libSystem.dylib ln /usr/lib/libobjc.A.dylib /usr/lib/libobjc.dylibNow compilation will be successful!
./main Killed!Oops...No luck... That's because you have not signed your application. iPhone OS have very strict rules to run applications on it. To sign your application you will need a provision profile(remember the story about official development)... Or... Let's say "THANK YOU" to Saurik again:
apt-get install ldid ldid -S main ./main Hello World!ldid - is a tool that can sign your applications and make them runnable on the iphone.
Let's try with full weight iPhone application!
- You will need additional header files which can be found in official SDK or you can download it from here(link from http://antirez.com).
Copy this folder into your iPhone and then to the /var/inculde
$ scp -r include-2.0-sdk-ready-for-iphone/ root@192.168.1.104:~/
# cp -r include-2.0-sdk-ready-for-iphone/* /var/include
- To avoid "framework not found" messages:
ld: framework not found CoreFoundation
You should copy frameworks folders from the official SDK to your phone.
# scp -r PrivateFrameworks root@192.168.1.104:~/
And install them:
# scp -r Frameworks root@192.168.1.104:~/cd Frameworks
ls | awk -F . '{print "mkdir -p /var/include/"$1";cp -r " $0"/Headers/* /var/include/"$1 ";rm -rf "$0"/Headers" }' | sh
ls | awk -F . '{print "mkdir -p /System/Library/Frameworks/"$1"."$2";cp -r "$0"/* /System/Library/Frameworks/"$1"."$2}' | sh
cd ../PrivateFrameworks
ls | awk -F . '{print "mkdir -p /var/include/"$1";cp -r " $0"/Headers/* /var/include/"$1 ";rm -rf "$0"/Headers" }' | sh
ls | awk -F . '{print "mkdir -p /System/Library/PrivateFrameworks/"$1"."$2";cp -r "$0"/* /System/Library/PrivateFrameworks/"$1"."$2}' | sh
cd ../
rm -rf PrivateFrameworks Frameworks - Now you can download on of the sample applications to start from. You can find one at http://antirez.com or http://blog.aaronash.com
Комментариев нет:
Отправка комментария