What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

How to create your own app for jailbreak iPad

jsherk

iPF Noob
Joined
Apr 19, 2011
Messages
78
Reaction score
1
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

  1. Create a file at /etc/apt/sources.list.d/coredev.nl.list containing the following line:
    Code:
    deb http://coredev.nl/cydia iphone main
  2. Create a file at /etc/apt/sources.list.d/howett.net.list containing the following line:
    Code:
    deb http://nix.howett.net/theos ./
  3. As root, issue this command:
    Code:
    apt-get update
  4. Then this command:
    Code:
    apt-get install perl net.howett.theos
NOTE: Steps #1 to #4 would only be performed once on your iPad and you should never have to do them again!

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:

f4780y

Super Moderator
Staff member
Joined
Sep 11, 2010
Messages
7,113
Reaction score
652
Location
Troon, Scotland
Thanks for the info. We have a development section, so I'm moving the thread over there where hopefully it can get some good feedback and grow into a valuable resource for the site.
 
OP
J

jsherk

iPF Noob
Joined
Apr 19, 2011
Messages
78
Reaction score
1
I have just updated instructions above with how to create a sample gui application as well.
 

zerozhu

iPF Noob
Joined
Jul 6, 2012
Messages
1
Reaction score
0
Hi,I am chinese,my english is not good,and i encount a question:
I followed you teaching ,and i successfully installed the .deb file on my jailbroken device,but it can not run,it just show a while,and then disappeared. can you tell me the reason,thank you ,if you know the reason,can you send to me. thanks very much!

[Moderator edit: Removed link to e-mail address. Please read our rules. Thanks.]
 
Last edited by a moderator:

seeskyline

iPF Noob
Joined
Dec 25, 2012
Messages
1
Reaction score
0
Location
中国
Hi,I am chinese,my english is not good,and i encount a question:
I followed you teaching ,and i successfully installed the .deb file on my jailbroken device,but it can not run,it just show a while,and then disappeared. can you tell me the reason,thank you ,if you know the reason,can you send to me. thanks very much!

[Moderator edit: Removed link to e-mail address. Please read our rules. Thanks.]



Hi, zerozhu, Have you worked it out? I encountered the same problem as you did. If you found the solution, could you tell me too? Thanks in advance.
 

shophia

iPF Noob
Joined
Mar 21, 2013
Messages
6
Reaction score
0
Location
USA
Hi jsherk. You put such a informative information about how to create your on app fora jailbreak iPad. You define GUI application example but I'm not getting your 6 point. When I Run make package install, at that time error will be occurred, can you please recommended it or give me solution of it.
 

Most reactions

Latest posts

Top