I was trying to figure out how to start writing my own apps for a jailbreak iPad, so here is what I figured out so far.
NOTE: This is all done on an iPad first generation 16GB WiFi with redsn0w jailbreak running iOS 4.3.2 and using my Windows XP PC to access it.
NOTE: My understanding is that the steps below will allow you compile C, C++ or Objective C.
HELPFUL LINKS:
Theos/Getting Started - iPhone Development Wiki
Chapter*1.*Makefiles
IRC @ irc.saurik.com (channel #theos )
STEP #1
jailbreak your ipad
STEP #2
From Cydia you will need to install
BigBoss Recommended Tools (id: bigbosshackertools)
I think you can use MobileTerminal directly on the iPad, but personally I access the iPad from my PC. I use PSPad to edit my text files, then use WinSCP to upload the files to the iPad and then use PuTTY for command line access.
To use WinSCP and PuTTY you will need to install OpenSSH from Cydia as well.
STEP #3
Install sdk version 3 (required for Theos to work properly). This is part of BigBos Recommended Tools. From command line type:
installsdk3
STEP #4
Install PERL and THEOS
COMMAND LINE TOOL EXAMPLE
STEP #5
Use New Instance Creator to create a NEW project. Type
cd /var/theos/bin
/var/theos/bin/nic.pl
For this example we will make a Hello World command line tool
Choose template: 4 (iphone/tool)
Project Name: helloworld
Package Name: com.memyself.helloworld
Author Maintainer Name: me myself
This should create a new directory (in your current working directory):
/var/theos/bin/helloworld
STEP #6
Open the following file with your favorite text editor:
/var/theos/bin/helloworld/main.mm
Add
printf("Hello World\n");
on the line BEFORE
return 0;
and save the changes.
STEP #7
Run make to compile using the makefile by typing:
/var/theos/bin/helloworld/make
This should create a new directory (obj) with your compiled command line tool.
STEP #8
To run our fabulous Hello World command line tool type:
/var/theos/bin/helloworld/obj/helloworld
That's it!
I just typed all this up from memory, so if you find a mistake let me know and I will fix it. Also, the #theos channel on IRC @ irc.saurik.com is where I got most of this info, so they are a good reference as well.
GUI APPLICATION EXAMPLE
Do Step #1 to Step #4 above if you have not done them already (they should only need to be done once, and then you won't have to do them ever again.)
STEP #5
Use New Instance Creator to create a NEW project. Type
cd /var/theos/bin
/var/theos/bin/nic.pl
For this example we will use the default application "red screen" with icon on the springboard:
Choose template: 1 (iphone/application)
Project Name: redscreen
Package Name: com.memyself.redscreen
Author Maintainer Name: me myself
This should create a new directory (in your current working directory):
/var/theos/bin/redscreen
STEP #6
Run make package install to compile using the makefile and install the app by typing:
/var/theos/bin/redscreen/make package install
This should create appropriate application files and directories.
STEP #7
You now need to re-spring the spring board. You can do this by either re-booting your iPad, or you can run the uicache command as the mobile user (su mobile first then uicache).
That's it! You should now have an application icon on the springboard called redscreen. Tap it and look at an amazing red screen!
UNINSTALL (applies to application only, not to command line tool)
If you need to uninstall your application, you would run dpkg -r packagename from command line, and then re-spring (reboot ipad or run uicache from mobile user):
dpkg -r com.memyself.redscreen
Again let me know if you find any issues!
NOTE: This is all done on an iPad first generation 16GB WiFi with redsn0w jailbreak running iOS 4.3.2 and using my Windows XP PC to access it.
NOTE: My understanding is that the steps below will allow you compile C, C++ or Objective C.
HELPFUL LINKS:
Theos/Getting Started - iPhone Development Wiki
Chapter*1.*Makefiles
IRC @ irc.saurik.com (channel #theos )
STEP #1
jailbreak your ipad
STEP #2
From Cydia you will need to install
BigBoss Recommended Tools (id: bigbosshackertools)
I think you can use MobileTerminal directly on the iPad, but personally I access the iPad from my PC. I use PSPad to edit my text files, then use WinSCP to upload the files to the iPad and then use PuTTY for command line access.
To use WinSCP and PuTTY you will need to install OpenSSH from Cydia as well.
STEP #3
Install sdk version 3 (required for Theos to work properly). This is part of BigBos Recommended Tools. From command line type:
installsdk3
STEP #4
Install PERL and THEOS
- Create a file at /etc/apt/sources.list.d/coredev.nl.list containing the following line:
Code:
deb http://coredev.nl/cydia iphone main
- Create a file at /etc/apt/sources.list.d/howett.net.list containing the following line:
Code:
deb http://nix.howett.net/theos ./
- As root, issue this command:
Code:
apt-get update
- Then this command:
Code:
apt-get install perl net.howett.theos
COMMAND LINE TOOL EXAMPLE
STEP #5
Use New Instance Creator to create a NEW project. Type
cd /var/theos/bin
/var/theos/bin/nic.pl
For this example we will make a Hello World command line tool
Choose template: 4 (iphone/tool)
Project Name: helloworld
Package Name: com.memyself.helloworld
Author Maintainer Name: me myself
This should create a new directory (in your current working directory):
/var/theos/bin/helloworld
STEP #6
Open the following file with your favorite text editor:
/var/theos/bin/helloworld/main.mm
Add
printf("Hello World\n");
on the line BEFORE
return 0;
and save the changes.
STEP #7
Run make to compile using the makefile by typing:
/var/theos/bin/helloworld/make
This should create a new directory (obj) with your compiled command line tool.
STEP #8
To run our fabulous Hello World command line tool type:
/var/theos/bin/helloworld/obj/helloworld
That's it!
I just typed all this up from memory, so if you find a mistake let me know and I will fix it. Also, the #theos channel on IRC @ irc.saurik.com is where I got most of this info, so they are a good reference as well.
GUI APPLICATION EXAMPLE
Do Step #1 to Step #4 above if you have not done them already (they should only need to be done once, and then you won't have to do them ever again.)
STEP #5
Use New Instance Creator to create a NEW project. Type
cd /var/theos/bin
/var/theos/bin/nic.pl
For this example we will use the default application "red screen" with icon on the springboard:
Choose template: 1 (iphone/application)
Project Name: redscreen
Package Name: com.memyself.redscreen
Author Maintainer Name: me myself
This should create a new directory (in your current working directory):
/var/theos/bin/redscreen
STEP #6
Run make package install to compile using the makefile and install the app by typing:
/var/theos/bin/redscreen/make package install
This should create appropriate application files and directories.
STEP #7
You now need to re-spring the spring board. You can do this by either re-booting your iPad, or you can run the uicache command as the mobile user (su mobile first then uicache).
That's it! You should now have an application icon on the springboard called redscreen. Tap it and look at an amazing red screen!
UNINSTALL (applies to application only, not to command line tool)
If you need to uninstall your application, you would run dpkg -r packagename from command line, and then re-spring (reboot ipad or run uicache from mobile user):
dpkg -r com.memyself.redscreen
Again let me know if you find any issues!
Last edited: