Quantcast
Channel: breadboard dreams » ios
Viewing all articles
Browse latest Browse all 2

iOS Dev for the Spanish Major: Building for Cydia

$
0
0

As I continue to brute-force my way through making apps for Cydia, my synapses are freaking out like socks on a shag rug. At the time of writing, I’ve just built my first app in Xcode and run it on my jailbroken iPod Touch, without paying Apple’s $99 developer membership fee.

If you’re not into coding, I’m afraid this post may not be very interesting. But for me it’s a breakthrough! (A breakthrough born of days spent slogging through Google results.)

The app: a simple 320×480 background, with some text on top. (I found some useful examples of text here.) For the icon, I chose an appropriate still from Dr. Strangelove. The name comes from Brad Neely’s “Wizard People, Dear Reader”.

The process:

1. Create a code-signing certificate in Keychain Access, à la this guy, but use the name “iPhone Developer”. You should only have to do this once; it gets you far enough past XCode’s Developer membership restrictions to build the app, but not install it on your device.

This is what you’ll see if you try and install it all the way through Xcode.

2. Write your app (in Objective-C), plug in your device, and hit “Build and Run” in Xcode. For me, the Xcode part of the process is done here; it doesn’t like the fact that my iPod firmware hasn’t been updated in a while.

3. I haven’t yet figured out where the “minimum OS version” setting is in the un-built files, so I manually change it after the fact, using Property List Editor (a default Mac utility):

To reach this setting, navigate to the “build” folder for your project, go into “Release-iphoneos”, right-click on [yourapplication].app and hit “Show Package Contents”, then open Info.plist with Property List Editor. I set the minimum down to 3.0, but it just needs to be lower than your current version.

4. Insert your built .app file — the one you just edited — into the required .deb file structure. Since I made a simple app, it has simple architecture, like this:

Saurik has a more complex example structure here. You do need a control file, and you can make it in TextEdit. Make sure it’s a plaintext file (Format -> Make Plain Text). I removed the .txt designation after saving it, though I have no idea if it’s necessary to do so. Here’s mine, structured after this guide:5. To make your .deb file, you need to have dpkg installed. To install it with MacPorts, fire up Terminal and input “sudo port install dpkg”. (Mad props to Major Majors for his help here! I had an ancient version of MacPorts, and my version of Xcode was missing large chunks, including the C compiler. Probably my fault for unchecking some things when installing Xcode; a reinstall fixed it.) Once dpkg is working, navigate in Terminal to the directory where your file structure is set up and run “dpkg -b yourappname“.

It doesn’t like a couple of my fields, but the .deb built fine anyway.

6. Now, you’ve got your .deb file, and you’ve got your device… time to mash them together! Fire up Cyberduck and SFTP into your device. (Hostname: the device’s IP address, found via Settings -> Wi-Fi -> blue arrow button next to your current network. User: root.) Follow the directions here to add the .deb file to your AutoInstall folder, then reboot your device. One reboot was sufficient for me.

7. That’s it! Test the app and thrash around on your laurels for a bit. You earned it.

This guide is for Xcode 3.2.6, on a Mac, for iOS version 4.1. There are many other guides that cover parts of this process in depth, or for different versions of Xcode and iOS. If you think this post can be improved, please let me know.

Strangelove approves.

I’ll figure out hosting later. Subject for the next post?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images