How To: Building ObjC Apps on the iPhone
By kroo, tested and debugged by darkten
product of the iphone-uikit team at irc://irc.osx86.hu/iphone-uikit
Before you start:
Things only work with an
intel mac right now. Make sure that you are using
10.4.10, and that you have installed the Apple Developer tools.
Step 1: Download some stuff
Download these things:
Name (with link)
| unarchive it, then put it here
|
| phonedmg | /Users/[your username]/phonedmg
|
Software Restore Image
| /Users/[your username]/phonedmg/[files go here]
|
| Macports | [just open the dmg, install it, then remove this file if you want]
|
anything else...?
| |
Step 2: Breaking into your iphone
(taken mostly from
http://www.hacktheiphone.com/iphone_first_ten_steps_to_modding.html )
- Quit iTunes
- go to the Applications directory, open the Utilities subdir, then double click Terminal
- type "killall iTunesHelper" into the terminal window, hit return
- type "cd ~/phonedmg" hit return
- Pray, hide in a corner, cross your fingers, or whatever you do for increased luck.
- type "./jailbreak", hit return, then follow the instructions
- if that didn't work, try once more
- if that didn't work, join irc.osx86.hu/iphone-uikit (or iphone-shell), and ask around
- type "./iPhoneInterface", hit return
- if all goes well, you should see a shell prompt (a line with "#" at the beginning)
- type "ls", you should see lots of different files -- especially System, usr, and bin directories
Step 2: Installing SSH
(taken mostly from NerveGas's SSH Tutorial at http://iphone.natetrue.com/)
- [TODO, put dropbearkey into phonedmg folder]
- Make sure you have a terminal window open, and that you are in the phonedmg folder (type "cd ~/phonedmg" if you are not, or are unsure).
- Open iPhoneInterface, and make sure you can still see lots of files when you type 'ls'
- Run these commands one at a time, and make sure nothing happens after you run them (except that a new "# " prompt appears)
mkdir /etc/dropbear
cd /etc/dropbear
putfile dropbear_rsa_host_key
putfile dropbear_dss_host_key
cd /bin
putfile chmod
putfile sh
cd /usr/bin
--- TODO list lots of binaries to put here
putfile chmod
putfile bash
putfile ls
--- End TODO
putfile dropbear
cd /usr/sbin
putfile update
cd /System/Library/LaunchDaemons
putfile com.apple.update.plist
putfile au.asn.ucc.matt.dropbear.plist
exit
- SSH should now be installed! reboot your iphone twice (just by holding down the power button, then sliding to shutdown), then run
ssh root@[your iphone ip]
- Clean up after yourself. In the terminal window (should not be running iphoneinterface anymore), run:
mv com.apple.update.plist.orig com.apple.update.plist
mv update.orig update
- now run iphoneinterface again:
./iPhoneInterface
cd /System/Library/LaunchDaemons/
putfile com.apple.update.plist
cd /usr/sbin
putfile update
Step 3: building toolchain
Congrats, you have made it this far. This is by far the trickiest section, with
lots o' hacks:
- Make a dedicated directory for your toolchain, put it at /Users/[yourusername]/toolchain/ or ~/toolchain for short.
- Make a dedicated directory for the unencrypted "heavenly" image -- at /Users/[yourusername]/toolchain/heavenly/ or ~/toolchain/heavenly/ for short
- open a terminal window, type "cd ~/toolchain", then type (or actually, please copy and paste): (Note: Decrypting the iPhone firmware image may be illegal in your country. Check with local laws before proceeding)
./vfdecrypt -i 694-5262-39.dmg -o decrypted.dmg -k 28c909fc6d322fa18940f03279d70880e59a4507998347c70d5b8ca7ef090ecccc15e82d
- next type "open decrypted.dmg"
- a terminal window should pop up. close it, and return to the terminal window. type
sudo cp -R /Volumes/Heavenly1A543a.UserBundle/* ~/toolchain/heavenly/
- we need to install libstreams.
sudo port install libstreams
- Next, we need to get the latest copy of the toolchain.
cd ~/toolchain/
svn checkout svn://svn.berlios.de/iphone-binutils/trunk
- if the second command returns immediately with "command not found", download and install it [link]? otherwise,
- Wait until svn is done
- now type
cd trunk/
./configure --with-heavenly=/Users/[your username]/toolchain/heavenly/
- Theres a problem with the makefile -- change line 34 to read:
cd llvm-2.0 && $(MAKE) ENABLE_OPTIMIZED=1 install
- wait for configure to complete, then make, and type your password at the prompt:
sudo make
- this installs lots of stuff into the /Developer/SDKs/iPhone/
- if you get errors during the compilation of llvm-2.0, try copying /usr/include/assert.h into llvm-2.0/include/ (Props to lednerk for finding a fix for this one)
- add the binaries to your path:
echo "export PATH=$PATH:/Developer/SDKs/iPhone/bin/" >> ~/.profile; source ~/.profile
- we need to do another round of downloading:
- we need to patch a few header files:
patch < /Developer/SDKs/iPhone/include/CarbonCore/MachineExceptions.h.diff
patch < /Developer/SDKs/iPhone/include/CarbonCore/fp.h.diff
When it asks which file to apply it to, paste in: "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h" for the first one and "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h" for the second one.
- you need to change /usr/include/machine/limits.h on line 5, /usr/include/machine/signal.h on line 26, and /usr/include/machine/_limits.h on line 25 so that it reads
#if defined (__ppc__) || defined (__ppc64__) || defined (__arm__)
- edit line 315 of /usr/include/sys/cdefs.h to read:
#if defined(__ppc__) || defined (__arm__)
- oh, and another thing the svn doesnt follow any order whatsoever -- to fix this for them, we kindly need to put libarmfp where it belongs:
sudo cp /Developer/SDKs/iPhone/lib/libarmfp.dylib /Developer/SDKs/iPhone/heavenly/usr/lib/
- a recent SVN commit just broke everything. you need to fix it: (all in the /Developer/SDKs/iPhone/include/UIKit/)
- Symlink your CoreGraphics/include dir to your include path:
sudo ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Headers /Developer/SDKs/iPhone/include/CoreGraphics
- UIPushButton needs to include CDStructures.h. put #include <UIKit/CDStructures.h> at the top.
- finally, try making the hello application!
cd ~/toolchain/helloapp/
make
guest said, 06/26/2008:
boobs
Free large boobs
Girls with big and sexy boobs
Little teen boobs sex
Lesbian women with big oiled boobs strips in the bath
Naked women bras and boobs only
Downblouse boob slip oops huge
Big boobs sex milf tan lines