TestinginProd
TestinginProd

Reputation: 1147

what do I type in terminal to compile C code for iphone on mac?

Hey all, Hoping to compile the "cat" program for iphone4. I figure the command to do so is gcc -somecommandtospecifyiphone. I want to do this on my mac and then just move the file to my iphone later. all compiler errors aside, what command do I type to do this?

Edit: Provided its not done via gcc or in a terminal or whatever, how would I accomplish this?

Upvotes: 1

Views: 576

Answers (1)

D.C.
D.C.

Reputation: 15588

What you want to accomplish isn't trivial for a couple of reasons (assuming you haven't jailbroken your iphone). first, each app you install is sandboxed, so you can't really pipe things into cat like you would want. Second, the lower level stuff on iphone is abstracted away, so you can't really bring up a shell and interact with cat. Finally, software on the iphone must be digitally signed. Xcode (the apple IDE) takes care of a lot of this stuff for you, but in the end it is still using gcc to (cross)-compile and install iphone software.

Here are some pointers if you still want to try to get this to work: - jailbreak your phone so you can install non-codesigned software on it - specify an arm architecture when compiling with gcc, better yet build your project in xcode and allow it to help you. You can also look into the commandline xcodebuild tool if you really want to stick to the command line.

Upvotes: 3

Related Questions