3

I'm working on improving iOS cross-compilation support for ghc, which has a metaprogramming feature which requires running code at compile time. One mechanism for this involves running a process on the target and communicating with it from the compiler via pipes. This is a standard unix process (one compiled for iOS), not an iPhone app. How can I launch this process on a connected iPhone from the OS X box where the compiler is running? For the simulator I can use simctl spawn but I don't know of anything similar for real devices.

1 Answer 1

4

You can't.

Jailed iOS devices have no method of executing any given program remotely. You'd have to jailbreak your device to be given access to terminal.

The iOS simulator is slightly different since it lacks many of the security features that the full iOS has, and since its running directly on your mac as child processes (rather than an emulator emulating a ARM processor).

3
  • It may be true that what I'm trying is impossible, but this reasoning doesn't make sense. You can link arbitrary native code into an app, anything unsafe/jailbroken I could do from a normal process I could also do from an app. Or, to put it another way, any process sandboxing that happens to an app could be just as well applied to the traditional process I want to run.
    – Shea Levy
    Commented Dec 10, 2016 at 19:40
  • @SheaLevy The reasoning makes perfect sense. Security features in a physiclal iDevice prevent any code to be run remotely from a connected computer. iOS on the device also takes care of full sandboxing of each app, therefore even if you run your process from inside an app, you will not be able to communicate with it from any other app or any other process.
    – Aleks G
    Commented Dec 10, 2016 at 21:29
  • Except I can run an app just fine from my computer.developer.apple.com/library/content/documentation/IDEs/…
    – Shea Levy
    Commented Dec 10, 2016 at 22:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .