A Beginners Guide To Getting Started In Cydia Tweak Development

This weekend at JailbreakCon 2012 the Cydia guru Ryan Petrich took the stage to talk about Cydia tweak development. His presentation’s main focus was actually how to get into Cydia tweak development and how to program Cydia tweaks.

Learn To Program Cydia Tweaks

Last year I wrote an in-depth article on how to develop a Cydia tweak from scratch, but it wasn’t as technical as people hoped for. As such, thanks to Ryan Petrich I was able gather some better resources on how a beginner can start developing software for Jailbroken iOS Devices.

How To Learn Cydia Tweak Programming

Step 1) - The first thing Petrich recommended doing was simply building a sample application in objective-c with UIKit. Essentially just ensuring that you are comfortable with native X-Code development. You can get started with this by purchasing an objective-c book, following online tutorials, or actually taking a course.

Step 2) - When you are comfortable with native iOS development then it is time to Jailbreak your iPhone, iPod Touch or iPad and install SSH. This will allow you access the root filesystem of your device and begin developing Jailbroken software. Visit our How To Jailbreak section for more information.

Step 3) - After Jailbreaking setup DeviceConsole, which is a handy command to view NSLogs and fprintfs outside of Xcode.

Step 4) – Next download and install Theos from Dustin Howett’s Github. Petrich states “it’s an amazing compilation environment that handles building, signing, packaging and installation for you. It even includes a handy transcompiler that makes method hooking really easy.”

A Beginners Guide To Getting Started In Cydia Tweak Development

Step 5) - One of the best ways to actually get started in Cydia tweak development once you have all the required tools is to look at open source examples. A huge library of open source Cydia tweaks can be found from TweakWeek or Petrich’s Github.

Step 6) - Once you are feeling more comfortable from looking at open source examples you will want to also download Class-Dump-Z. This tool by kennytm will allow you to get a peek at all the private APIs that are available under the hood of iOS. It shows everything… no really!

A Beginners Guide To Getting Started In Cydia Tweak Development

Yet another useful tool is Cycript. Petrich states “Cycript is a tool that Jay Freeman has built to make exploratory programming much simpler on iOS. It marries JavaScript with Objective-C syntax and makes testing private APIs or nudging view positions much less cumbersome.” Essentially Cycript is the perfect tool for live-coding on iOS, and it is available in Cydia. You can use the following command to print out a list of all views:

cycript -p SpringBoard
[[UIApp keyWindow] recursiveDescription]

Step 7) - Finally if you are having problems or would like some clarification on things you can reach out to other developers on IRC. Simply join the #iphonedev channel on irc.saurik.com. Don’t forget to also use Google, StackOverflow and The iPhone Dev Wiki to your advantage as well.

There you have it! Hopefully these resources from Ryan Petrich’s JailbreakCon 2012 presentation will be of use. If you have any further resources/suggestions or just need some help please make use of the comments section below.
Don't forget to follow iJailbreak.com on Facebook, Twitter and Google+. Be sure to check out our partnership page where you can get mentorship on starting your own business online.
  • Confused

    Cycript is no longer in Cydia. I have looked up the repo and everywhere it says that it is in the Saurik default repo and it has not popped up in the search bar.