Search code examples
frida

How to write a loop in REPL mode?


I would like to execute a loop in REPL mode but I am getting a SyntaxError: expecting '('

var methods = eval(ObjC.classes.UIViewController.$methods);
for item in methods { console.log(item) }

Solution

  • This problem is related to command line shells and not to Frida or any other REPL tool.

    This is a Single command and multiple lines subject of a shell in terminals.

    To solve it, all you need to do is to add "\" at the end of each line.

    Example:

    var methods = eval(ObjC.classes.UIViewController.$methods);\
    for (item in methods) { console.log(item) }\