4.2 Cycript
Figure 4- 9 Cycript
Cycript (As shown in figure 4-9) is a scripting language developed by saurik. You can view
Cycript as Objective-JavaScript. A lot of you may not be familiar with JavaScript, then
subconsciously think Cycript is very obscure. In fact, I, as a lazy learner, do not know JavaScript
either, so in a long time, I’ve ignored Cycript deliberately. It wasn’t until not long ago when I
was playing with MTerminal during my company’s boring meeting and tested a few Objective-
C methods in Cycript, then I had a new awareness of this simple yet powerful language. In fact,
for Objective-C programmers, scripting languages are not difficult to use, as long as we
overcome our fear of difficulty, we will be able to handle them very quickly, and Cycript is no
exception. Cycript has the convenience of scripting language, you can even write App in
Cycript, but saurik himself said, “This isn’t quite ‘ready for primetime’”. In my humble opinion,
the most practical usage of Cycript is testing private methods in an easy manner, possessing
both safety and efficiency. Therefore, this book will only use Cycript to test methods. For its
complete manual, please visit the official website http://www.cycript.org.
We can launch Cycript either in MTerminal or via ssh. Input “cycript” and it outputs “cy#”,
which indicates Cycript’s successful launch.
FunMaker-5:~ root# cycript
cy#