Running python/ruby script on iPhone?

16,872

Solution 1

Apple recently changed their policy on this and allowed a python interpreter App called Python for iOS to be put up on the App store:

http://itunes.apple.com/us/app/python-for-ios/id485729872?mt=8&uo=4


Full disclosure: I am the sole creator/developer of Python for iOS.

Solution 2

At present not at all. Apple licenses forbid to run any intepreter on it, and this is even before iPhone OS 4. You can make an intepreter by jailbreaking it but it won't be official and you won't be able to distribute it.

Solution 3

I don't distribute the python script, I just use it for my own utility. Even in this case, do I need a jailbreak?

No, you don't. You can compile a Python interpreter and run it on your own iPhone, as long as you have a developer license.

Maybe you can use ad-hoc distribution (according to Apple, you can distribute your app to 100 devices by yourself, outside of the app store) ? See here

Share:
16,872
prosseek
Author by

prosseek

A software engineer/programmer/researcher/professor who loves everything about software building. Programming Language: C/C++, D, Java/Groovy/Scala, C#, Objective-C, Python, Ruby, Lisp, Prolog, SQL, Smalltalk, Haskell, F#, OCaml, Erlang/Elixir, Forth, Rebol/Red Programming Tools and environments: Emacs, Eclipse, TextMate, JVM, .NET Programming Methodology: Refactoring, Design Patterns, Agile, eXtreme Computer Science: Algorithm, Compiler, Artificial Intelligence

Updated on June 21, 2022

Comments

  • prosseek
    prosseek almost 2 years

    From the recent news from the Apple, I learned that one has to use C/C++/Objective-C for iPhone App. Accordingly, it's not possible to use MacPython or similar to make iPhone App.

    But as the python/ruby interpreter itself is written in C, isn't it OK to make python/ruby interpreter for iPhone to run the scripts on iphone?

    Is this possible? Does Apple support this? Or does someone implemented this? Or, the user should hack to do this?

    Added

    I don't distribute the python script, I just use it for my own utility. Even in this case, do I need a jailbreak? I mean, can I compile the python with Xcode to get the binary? Or, I expect someone has already done this.