views:

3039

answers:

10

Possible Duplicates:
How to develop iPhone applications on a windows PC
How can I develop for iPhone using a Windows development machine?

I'm looking to build an iPhone app for my wife's phone, but am not interested in buying a Mac as a development platform for a one-off piece of work. The app:

  • should run standalone on the iPhone (i.e. without network connectivity)
  • would be perfectly acceptable with a GUI created using one of the iPhone Javascript libraries that are around
  • will do some database IO to read and update data
  • has no commercial value and will never be used by anyone else

Here's my thinking:

  • jailbreak the iPhone
  • install Ruby + Sinatra on the iPhone
  • write the app using Sinatra, hitting a database (SQLite?) on the iPhone

To access the app on the iPhone:

  • start the Sinatra app in the background (is this possible?)
  • start a Safari browser session
  • navigate to the Sinatra app at e.g. http://localhost:12345
  • etc.

This seems like a strange approach, but I can't think of a simpler way of writing a standalone iPhone app without buying a Mac. Is there a better way of doing this?

+3  A: 

The only reliable info I could find is at the always-excellent MetaFilter

http://ask.metafilter.com/110466/Anyway-to-develop-iPhoneiTouch-apps-without-investing-in-a-Mac

The answer is apparently no.

You absolutely need an Intel Mac of some description.

The entire iPhone build process is too deeply ingrained in XCode to build elsewhere; and the only other Objective-C compiler I know is gcc, which doesn't support any Apple's additions to the language (nor their libraries).

And, in direct opposition to what people are saying above, Objective-C is absolutely my favorite native, compiled language. Elegant, small (only a few changes from C), late-binding, dynamic, straightforward. It's what C++ should have been.

Lots of people recommend picking up a secondhand Intel (remember, must be Intel!) Mac Mini as the cheapest "port of entry".

Jeff Atwood
the answer is not no, see my answer on the open toolchain
hhafez
Yeah some people have poked around and got it working on PPC, apparently.
Nosredna
the open chain works on linux not just the mac, you can even get it running on the phone itself (ie: compile and install from the phone!) all you need then is to remotly login to your phone edit/build/install/run :)
hhafez
Actually, Apple's compiler /is/ gcc. What you can't get elsewhere is the code signing required for the iPhone, the simulator used to test, and on-device debugging tools that won't void your warranty. Personally I use gcc right on the phone via the open toolchain as rules were meant to be broken :)
rpetrich
+1  A: 

What you have described is a viable solution, however you should consider using the open toolchain for the iphone.

You don't need a mac then, only need to jailbreak the phone to make sure your app will work.

For all those who say it can't be done, this was the only way to make Apps for the iphone before the SDK was out :)

Also if you are after a guide to using the open toolchain then I highly recomend this book

hhafez
Thanks for the pointer to the iPhone open toolchain. I hadn't heard of it before, and it's definitely overkill for what I want to do, but it's certainly an interesting project.
Dave
+2  A: 

If you're considering creating a GUI using a javascript library anyway, why don't you just write a web app instead of an iPhone-native one? It seems like overkill to jailbreak the device just so that you can install a ruby + sinatra web app on it. Can't you just put the ruby web app on a server and create a Safari shortcut to it on the home screen? If you don't have a server, you could always run the website off a PC in your home...

Jailbreaking the OS and running a ruby app onto it would be technically cool, don't get me wrong - I just think it'd end up being a time sink.

Just my 2c!

Ben Gotow
Thanks Ben. Unfortunately, one of the places this app would be used just happens to be in a reception dead spot - no phone signal, no 3G, nada! I've already written a couple of iPhone Web apps that run on one of our hosted servers and they work fine; this is just a one-off bit of work, and I can't really justify spending any sort of $$$ on a solution
Dave
+2  A: 

Depends on what your time is worth, I guess. That seems like a terribly convoluted way to get what is otherwise a simple app on the phone to avoid the US$400 purchase of a used Mac Mini.

There is the hackintosh route, which may work on your existing hardware, but again one has to put a price on time. It's what got me started before I dropped big coin on a Macbook Pro, an MSI Wind then a home-built. It's of questionable legality (the right thing to do is fork over US$129 for Leopard regardless), but you are already talking about jailbreaking. :-)

mikestew
Jailbreaking is quite legal where I live, and I don't have any concerns about "moral" issues given what I'm trying to achieve. I'm writing a one-off app for a single person, not bringing down an empire, and all I want to know is whether it's technically achievable in the way I've outlined.
Dave
+1  A: 

Get someone else to do it, or rent the resources that you need.

Another option is to find nearby iPhone developer who has it all setup and either get him to write the app or do it together, he provides development environment you code the solution or code it together.

The only problem is that you wont be able to update maintain it.

I would still consider getting older gen Mac or Mac mini - all the other options sound more complicated.

stefanB
A: 

Come on, just look on eBay for the cheapest intel mac mini you can find. Even a Mac laptop with a busted screen (that you could hook to an external display) would work. You're talking just a few hundred dollars probably and then you can maintain it as her phone/Touch is upgraded.

Kendall Helmstetter Gelner
It's just not worth my buying a Mac to do this. The app is basically replacing a paper notepad and pencil (OK, it's *slightly* more complex than that), and I'm doing it as a favor for my wife. I'm not about to spend $400 on something to replace a $1 notepad, but I am prepared to spend the 2-3 hours to write the app in Sinatra Note it's not a what-price-do-I-put-on-my-own-time or a how-can-I-hack-the-iPhone issue; it's a can-I-make-my-wife's-life-a-bit-easier-with-little-effort-on-my-part issue
Dave
A: 

If you are going to be stubborn about not using a mac, but you want an app that will work offline with the iPhone / iPod Touch and Android devices, then I would use HTML 5 to create an offline app.

You can do a lot now with HTML 5 - Google have an email client that uses HTML 5 for the iPhone now and it can work offline etc. If you do this and get the user to add a bookmark to their home screen for your app - it will be almost as good.

If I was you I'd fork out for a mac - or look to see if you could borrow one - or time-share with someone - you will not create a very good quality app without it.

Grouchal
A: 

there's some special meta tags you can put in a webpage to make your web app savable and full screenable to the iphone hard drive. (so it can work offline) Here's an example : http://mrgan.tumblr.com/post/125490362/glyphboard2

There's also frameworks like phonegap that let you access cocoa apis from javascript, but it sounds like you don't need that.

Breton
A: 

You can jailbreak the phone and install Python. There are some sample applications in Cydia for it (it's called iPhone/Python. Search for Python in cydia).

Then you will have a "native" app, not a web application and you can use the entire iPhone UI library (the part of it that is accessible via py-objc anyway) and you don't need to run a web server in the background.

You can do your development on the phone itself via SSH or you can use an iPod Touch for it. Packaging is also easy (should you need it), just create your own Cydia repository and host your package(s) in there.

Look at iPhone applications in Python for more information.

Gerco Dries
A: 

Does your wife enrolled in any kind of data plan? If so, you can simply write a small webapp which runs on some cheap webspace and access it via MobileSafari.

If you need a full grown iPhone application, you better look after one of the first intel-based mac minis on eBay, should be to expensive, in my opinion. And as a plus you avoid the hassle of a jailbreak.

DASKAjA