tags:

views:

1717

answers:

3

I'd like to develop and run my iPhone applications from the command line and my personal editor instead of having to use Xcode.

So far I've been able to edit all the files in Emacs and run

xcodebuild
in the project to compile/link/etc.

The next step would be to create a Makefile task to launch the iPhone Simulator with my current application. Any ideas of how can I do that?

Update: I'm not interested in XCode calling my editor, I just want to forget about the IDE as much as I can.

+7  A: 

All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/User/Applications/[somefolder]/, with a file named [somefolder].sb (alongside the folder, not in it) containing the following:

(version 1)
(debug deny)
(allow default)

Then, launch /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator. Not sure how to get it to launch a specific application, but that'll take you to the home screen.

Noah Witherspoon
Do you know if it's possible to do the same thing with the real iPhone instead of the simulator?
Adam Rosenfield
I doubt it. If you jailbreak your phone and install SSH on it you could set up something to copy the .app over wifi, but that's a fair bit of work.
Noah Witherspoon
@Adam Rosenfield, it's a lot of work, but here's how to do it. http://stackoverflow.com/questions/2357731/self-signing-code-in-xcode-for-iphone
Yar
+2  A: 

Note also that you can set up XCode to use external editors, even for source code. In this setting, you'd open XCode to look at the treeview displaying the files and other items making up your project, but once you double-click a sourcecode file it would open in e.g. Emacs.

There's a screencast over at Mac Developer Network demonstrating this: link

harms
Xcode automatically detects when the project files have been changed, so you can just edit in emacs without doing anything special.
Adam Rosenfield
A: 

I doubt it. If you jailbreak your phone and install SSH on it you could set up something to >>copy the .app over wifi, but that's a fair bit of work. – Noah Witherspoon Jan 13 '09 at 5:24

I did all of my beginning iphone development work this way. Just ssh'ing over the binary executable and whatever other files you might need (after you locate the App folder on your phone) is actually much faster than installing the application from xCode. Note that I wasn't running the debugger.

Colin Worth