Developing for a Jailbroken iPhone A to Z (iPhone 3.1.2)

Debugging on device. Freaking finally.

Debugging on device. Freaking finally.

UPDATE: There’s a new method for iOS4 but they’re pretty similar anyway.

So it’s been a while, but now that I’m on break again and have some time, I’m doing a bit of iPhone development again. That means I’m going to need to debug on-device (or at least load my app to it to have fun in the real world with my handiwork). This time, the procedure’s a little different though.

Vital stats:
iPhone OS 3.1.2
Xcode version 3.2.1, 64 bit
Mac OSX 10.6.2 Snow Leopard

Let’s do it.

UPDATE: Corrected a problem with the run script build phase: corrected the directory names for the new version and copied the new phase that doesn’t include “resource_rules.plist.”

UPDATE 2: Somehow I forgot the add an identity step. It’s now #1 below. Sorry guys. Also, while this whole thing should apply to iPhoneOS 4, I’m going to officially text it/repost with 4.01 soon.

Continue reading

Climate Change and Electrical Engineering #BAD09

So I know if you’re reading this, you’re probably pissed with me for not posting about the iPhone re: the latest updates, but the comments on the old post seem to be doing the job, so for now, I’m going to shift topics a bit (I promise, I’ll write a new iPhone post soon. I want to do some dev myself anyway).

I’ve said before on this blog that I’m an electrical engineering student right now. Specifically I really enjoy designing power systems: things that require lots of volts but even more amps. I’ve also sort of been an environment enthusiast for a long time and being a techie in general, things like veggie oil buses and renewable energy systems come as natural interests to me. The nexus of all these things is very convenient for someone in my situation: I like electronics, and all of these things require electrical design.

More specifically, though, let’s talk about renewable energy. The principal problem right now with things like wind power and solar energy is that they’re unpredictable. Hydro power doesn’t so much have this problem because most hydro dams have a man-made reservoir behind them and locks can be opened and closed as needed, but most other renewable resources with enough capacity for mass production are, in terms of availability, at the mercy of the weather.

The reason this is a problem is that our current grid is dumb. It delivers power from one spot to another, more or less instantly, with no wiggle room. In other words, the input (power generated) has to be slightly greater than the mass usage on the grid at any given time. If it’s less, obviously there isn’t enough power and you get brownouts or grid shutoffs. If it’s too much more, you’re just wasting energy, and if it’s not enough more, you run the risk of brown or blackouts caused by momentary spikes.

Sidebar for a moment: What is a brown out and what is a black out? First, imagine your cordless drill. When the battery is dying, the drill doesn’t stop all of a sudden, it gets slower and slower. If you let it go long enough, it eventually it stops, but mostly it just goes too slow to be useful, and loses all power against whatever you’re screwing or drilling. This is because of how a voltage source (like a battery or a power plant) works. A voltage source tries to keep the potential across its terminals constant. Think of it like a bath tub full of water, with a guy sitting there turning the faucet on and off as necessary to keep the water level constant (to go into depth, the faucet is like the chemical source of energy – the coal being burned, the nuclear fuel being fizzed, or in a battery, the chemical reaction going on). The motor of the drill, though, is eating this power ravenously, but it can only eat so fast. Usually, the chemical reaction in the battery can outstrip the motor’s demand, keeping the voltage level all the time. When that reaction starts to use up all its reactants, though, and it starts going more slowly, it can’t convert energy fast enough to keep up with the motor’s demand. As a result, the voltage across the battery drops, and puts less power into the motor, which slows down and loses torque.

The same thing happens on the electrical grid that serves your house. If the grid tries to pull energy out too fast, faster than power plants can supply it, the voltage on the whole grid drops accordingly, just like the tub draining faster than the guy working the faucet can fill it. Usually, when a situation like this is encountered, the grid fails before the power plants (that is, the grid’s wires would melt or burn or be otherwise damaged by so much transmission, and to keep everything safe, automatic shutoff switches kick in and some supply line is cut. Sometimes supply duty fails over to adjacent grids, keeping the lights on, but sometimes adjacent grids can’t supply enough so it doesn’t, or worse, it does fail over and the adjacent grid BECOMES overloaded and shuts off. In either case, the grid automatically shutting off results in zero voltage at your house, and it’s called a blackout (the lights turn off).

Sometimes, especially in California (they’re famous for brownouts), the grid doesn’t shut off. Instead, it stays on, and power plants simply can’t keep up. As a result of the tub draining faster than it fills, the mains voltage for affected areas drops outside of acceptable limits (in the US, mains voltage is 120v, but that is intended to safely vary within +-10% or so). This is called a brownout because the lights just dim instead of turning off (though other appliances may actually behave erratically or be damaged). There, now you know what a brownout is and why it might happen.

Since the output of both Wind and Solar plants depend intrinsically on the weather, this system isn’t very practical. That is, if supply=demand needs to stay true, and if demand varies with lots of factors, supply can’t also vary. We have to be able to control it. With wind and solar, we generally can’t. Basically, there are two options to achieve a grid powered entirely by abundant renewable resources. Either find a way to make those power sources variable (key aspect: increasable. We can always throw more coal on the fire, we need to be able to blow more wind on the turbine if we’re to replace the coal. We can always stop the turbine entirely, that’s not the problem), or instead, design some sort of grid where supply=demand doesn’t have to always hold true, only over the average across some period of time.

Seeing as how it’s generally impossible to conjure wind or move the clouds (not that either would be a good idea anyway), the only real option is to design a flexible power grid.

Enter the “Smart Grid”

The idea behind the smart grid is to build in storage and intelligent sensing such that the grid itself always knows how much power is needed and how much it has available to it in both original generation and storage. Designing components of such a system is one of my primary areas of interest as an electrical engineer. By converting to an electrical distribution system as intelligent as the internet, we stand to gain a LOT of leeway in the kinds of consumers and producers of energy available to us going forward. Just like a Prius reclaims lost energy by braking and saves energy by not using the motor when it doesn’t need all the energy it can provide, our new smart grid can sip energy over the long term from the ocean or earth below us (wave generation and geothermal heat exchange, respectively) for us to use when we really need it, maximizing our ability to generate energy and optimizing our usage of it, while acknowledging the fact that the general populous isn’t going to self-regulate demand on the whole.

And of course, it goes without saying that all of this is necessary if we are to do anything as a society about reversing or at least stopping our extremely unsustainable energy policies. It’s generally acknowledged that the atmosphere simply can’t support sinking any more carbon, which is the largest byproduct of our current energy generation techniques. Even assuming that we’re OK at this very moment, which we’re likely not, we’d have to basically shut off operations worldwide in order to reduce our carbon output to a level that the earth is naturally capable of dealing with. But that’s only the bad news. The good news is that if we pursue the strategy above, and if we do so quickly and successfully, we have much less to fear both immediately and going forward. The beauty of sustainability is that it’s sustainable, and that peace of mind doesn’t disappear after you’ve established sustainability the first time.

This post was written for Blog Action Day 2009, http://www.blogactionday.org/. The issue this year, climate change, happens to be both important and eminently relevant to me, so I chose to break my traditional content mold. Also, I’ll probably try to follow this up a bit later as there are some topics I feel I glanced over or didn’t cover deep enough.

Portland Pie Company Has the Best Gluten Free Pizza Ever

I just had lunch at Portland Pie Company in Portland, ME for the first time, and their gluten free pizza is absolutely phenominal. It’s expensive at $13 for a 9 or 10″ pizza, but it’s loaded with toppings and is actually filling, which can be a problem with GF crusts. It’s also got exactly the spongey flexible feel that most GF pizzas lack, which seats it comfortably as the best GF pizza I know of. If you live in the Portland area (or Scarborough or Westbrook) go there and buy lots so they keep it on the menu.

If You Are Gluten Free, Avoid Snickers

Snickers don’t contain any gluten in the ingredients, which is typically all I care about. I don’t have celiac disease, just a gluten sensitivity, so I typically don’t worry TOO much about cross contamination. I just had a Snickers, though, and my stomach hates me now which is fair warning that if you have even the mildest sensitivity, you should probably avoid them unless you don’t mind getting sick.

My Gmail/Google Voice Productivity Tip of the Day

Heavily redacted, mostly just because I like the Gaussian Blur filter.

Heavily redacted, mostly just because I like the Gaussian Blur filter.

No, I don’t actually plan to write a Gmail/Google Voice productivity tip every day. However, today I just happen to have one. Parts of this actually came from a good friend, @jamesconnors (his site).  He told me his system for inbox management: he has his inbox, a “follow up” folder, an I believe another folder for stuff he just wants to keep around. Anything in his inbox that he can’t quickly respond to in a minute or two when he sees it, he puts in his follow up folder. Every so often, maybe once every day or two, he goes through his follow up folder and takes care of everything he can.  Continue reading

Jailbroken OS 3.0 is a Buggy Ass Piece of Shit

crashyI hate to have to report this, but it’s just sad how crappy the current experience is on 3.0-JB. In some order:

  • Cydia crashes like crashing is its job. Tap search then manage – boom, crash. Uninstall an app – 50% likely crash. click too many items in a row because cydia is slow but you know your way around – crash. In fact, you can really just imagine crashing for a split second, and it will happen, wherever you are. Restoring my phone to its previous state of installed apps was failing so badly that I installed apt and did it from an SSH session. Only to find out that Aptitude is broken. At least there is apt-get, too. But alas, I still didn’t get very far, since NONE of the apps I previously had work. Starting, most obviously, with Backgrounder.
  • Backgrounder is (temporarily) dead. This isn’t that critical, per se, since apps usually crash while in the background anyway, but I’m annoyed not to have it because at least Pandora would reliably stay alive while you emailed or, to a lesser extent, texted. Now, no matter which method you use to invoke Backgrounder, the invocation tanks MobileSubstrate and sends it into safe mode. Bummer. And Pandora Controls was a nice pairing for backgrounder since you could use it to control Pandora from other apps just like the iPod. Kind of a moot point, if backgrounder is dead, but
  • Pandora Controls just doesn’t work, at all. Worse, it causes Pandora to crash on launch. Yay safe mode. Don’t install it.
  • I could probably survive in the time being before repairs to the above by using one of my FAVORITE iPod apps, Instinctiv Shuffle. It is basically a smart shuffle hooked into the iPod app that attempts to shuffle your full library based on your mood, and it seems to work pretty well. It pretty much just makes shuffle less random, playing similar songs to the ones you recently didn’t-skip, but it’s a nice addition for the car. But it doesn’t install on 3.0. Boo.
  • hClipboard straight doesn’t work. Yeah, there’s official copy/paste now, but I liked the templates feature, not having to re-enter email addresses all the time. And I liked a multiple-entry clipboard. And iKeyEx had other cool features.
  • ICY is cool, but also buggy: So far, I’ve found that you can reliably crash it by cancelling an app install.

And then there are a ton of other stupid issues. Like what’s up with this screenshot?

What the hell.

What the hell.

There’s no text entry field there, guys. And in general, things seem slower (though some faster). Overall, this could be going better.

All I can say is thank god PdaNet works, since AT&T will inevitably break the official tethering channel. I will admit, the iPhone interface for it is cooler and less goofy, but it also doesn’t work (for me, won’t connect). And when it does, you’ll get charged out the ass for it, which is key too.

iPhone OS 3.0 Gold Masters Relased

Get them while they’re hot! http://www.iphone3g-mods.com/ (coral) has a great list of download links for all the various hardware versions. There are a couple of notes: First, this is intended for developers only. As such, these FW versions lock your phone into “testing mode,” meaning you can’t then downgrade to an old version. Also, this final pre-release is not jailbroken (rather, it probably is, but the JB is as of yet unreleased). So don’t plan to use this on your main device if, like me, you rely on your jailbreak. I’ll probably only install this on my iTouch 1G, and wait for a proper jailbreak following the official release.

New Theme

I’ve been meaning to do this for a while. I liked the old theme, but it was just too thin. It wasn’t really clean enough for my taste when my content was wider than 300px, so here’s a new theme I kind of like. I’m actually making my own theme from scratch, and I’m super excited for the things I’m putting in it, but it just won’t be ready for a while.

Soldering The Thinnest Wires Ever Conceived: Headphone Modding

Acrylic insulated wires stink, for sure, but when they're stranded and micro-fine, they stink WAY more.

Acrylic insulated wires stink, for sure, but when they're stranded and micro-fine, they stink WAY more.

I may use this blog to post mainly iPhone or software related articles, but I am an electrical engineering student, and as an EE, I love me some good, clean hardware. Therefore, when my favorite pair of earbuds kicked the bucket the other day, my first thought went to the in-box iPhone headset and, more importantly, how much those earbuds suck. My favorite bang-for-the-buck earbuds EVER are Skullcandy Full Metal Jackets, primarily because I got them at TJ Maxx for $25. In general though, they have silicone pads that seal out sound, instead of the hyper uncomfortable iPod earbuds that fall out and sound like crap. I was super bummed when my FMJs broke, but luckily, the part that broke was on the plug end of the earphones. That is, both earbuds themselves still work fine, only the plug is dead. My thought was to cut the crappy iPhone buds off their cable (which includes a microphone and remote button) and graft on my beloved FMJs.

Continue reading