Thursday, May 15, 2008

IMPORTANT: New info for jailbreaking

Some changes I have to the stuff that I wrote previously:
  1. Install Cydia first. This is a package manager (similar to adept). It installs, but more reliably. It's also much more compatible with the BSD system underlying the iPhone.
  2. Do not install the BSD subsystem package. Cydia has its own version of the stuff.
  3. You can still use Installer if you want, but Cydia will contain many of the same packages.
  4. Install Bosstools immediately after Cydia, and then use it to "make more space for apps". It changes the path name used for installing applications, which in turn puts them in the large partition on your iPhone. If that means nothing to you, don't worry, just do it.
  5. Remember to sync your iPhone on a regular basis, to avoid the hassle of recreating stuff. You never know when an app is gonna brick your phone.
  6. I have yet to see a killer app for the iPhone, other than Safari which you get even if you don't Jailbreak.

Tuesday, April 15, 2008

Main Script Execution Failed (Yipe!)

While I was trying to install new apps, I started getting the message "Main Script Execution Failed!" This means that the installation script died somewhere, of course, but where? and why?

Well, a Google search told me that it's actually due to a little-known gotcha in the iPhone version of OS X.

OS X is based on BSD Unix, and like all other versions of Unix, it maps path trees to "disks" and partitions on disks. This is different from Windows (which derives much of its file system from DOS), in which each partition becomes a separate volume with its own root and path tree that has access to all the free space on the volume.

The UNIX architecture is a lot more flexible, but it can result in having directory trees mapping to different disks. For example, I can force /user/jmalin and /user/someuser to reside on different devices, if I want.

This is what iPhone does; it reserves a small "volume" for the OS files, and gives the rest to "user" files. The problem is that apps are installed by default to the OS file volume! You will soon run out of space on that volume if you install apps to a jailbroken phone.

The solution is to use a utility to move your apps to the "user" volume. The best one I've found is BossTool. Install it, run it, and ask it to move applications. It does the rest. The Main Script Execution Failed error is a thing of the past.

Friday, March 28, 2008

iPhone: Jailbreak start to finish

While it's still horribly fresh in my mind, various notes about taking your iPhone from a merely interesting toy to a complete, powerful productivity-destroyer:

  • ZiPhone is one-step shopping for jailbreak/installing Installer/getting the best app sources
  • Good sources include AppTapp Official, Ste, NullRiver, BigBoss. Also ModMyiPhone.
  • Conceited Software has w00t stuff, but their server is flaky. I've had to remove them and re-add them. What gives?
  • Thank you: ZiPhone, Erica Sadun, NullRiver, Roz, John B., and others.
  • Things You Should Learn To Do:
    • Reset your iPhone (Settings > General > Reset > Reset all Settings)
    • "Reboot": Home+Sleep for 7 seconds, shut down, Sleep for roughly 3 seconds
    • Restore: ZiPhone to set it back to "normal", then iTunes. Note: the iTunes update servers may be offline. Don't panic.
    • Find Sources: Run Installer, select Sources, Refresh.
    • Add a Source: Installer > Sources > Edit > Add. You'll need to know the URL of the source.
    • Remove a Source: Installer > Sources > Edit > click red circle/line on left, click Delete on right. Alas, I don't know how to restore sources, yet. You may need to remove a source to avoid install problems.
    • GOOGLE SEARCH: Everything I've written here I learned by searching. Don't bother your friends or post to a forum until you've done a Google search.
  • Steps to take:
    • Valium :)
    • Sync iPhone to back up.
    • Install ZiPhone and iphonebrowser on your PC. I don't have a Mac, so I can't help there. Don't have them yet? Where to find them? Remember what I said about Google Search?! 'Nuff said.
    • ZiPhone jailbreak. Yes, you may want to unlock your iPhone. I decided I could live with ATT, having lived with them for several years already. If you're not in the US, I can't help you. I didn't unlock my iPhone; to quote John Cleese: "I may be a fool, but I'm not stupid!"
    • On your iPhone, run Installer. All instructions from now on are on iPhone.
    • Install these key apps. See this blog for more details!:
      • BSD Subsystem
      • BSD Subsystem 2.0 Term fix
      • Community Sources
      • SUID Lib Fix
      • ZiPhone iBrickr fix
    • Install other apps as you like. I can recommend:
      • MobileFinder, MobileTextEdit (thanks Erica)
      • Term-VT100 by Conceited Software
      • Erica's x, a set of utils, etc. by Erica Sadun aka Ste
      • Categories, by BigBoss. Be careful. Most of my experience with iPhone hacking comes from recovering from stupid use of Categories. Read the directions and help first!
      • HP12C, HP15C, HP16C by Thomas Fors. For us former HPers and fans of RPN.
      • SendFile by (who else) Erica Sadun.

iPhone: more on copying to and from

Thanks to a valiant and long-suffering colleague, I can now tell you that iphonebrowser is the way to access your iPhone.

Here's how to prepare for iphonebrowser (see notes at the bottom for more info):
  1. If you have iphonebrowser running, shut it down.
  2. Jailbreak phone with ZiPhone 2.4.
  3. Install the following apps:
    1. BSD subsystem 2.0 (source: AppTapp Official)
    2. Community Sources (comes with Installer 3, which comes with ZiPhone)
    3. BSD Subsystem 2.0 Termfix (source: BigBoss's Apps and Things, which comes with ZiPhone)
    4. SUID Lib Fix (source: BigBoss's Apps and Things, which comes with ZiPhone)
    5. ZiPhone iBrickr Fix (source: http://i.unlock.no)
  4. Shutdown/restart your iPhone:
    1. Hold the Home Key and the Sleep key together until a red slider appears at the top of the screen, prompting you to slide it to turn off your iPhone.
    2. Turn off your iPhone.
    3. Hold the Sleep key for a few seconds to reboot.
  5. Run iphonebrowser. You should see a long list of directories. This is entire filesystem!

iPhone: killer apps

Here's my current list of iPhone killer apps:
  • ziPhone: a desktop app that jailbreaks and unlocks iPhones. You need this to break free of Steve's citadel of evil. And to unbreak it if you need to.
  • Installer: make your iPhone a real tool.
  • MobileFinder: Finder for iPhone; great iPhone app for looking around your phone's OS.
  • BSD subsystem 2.0+BSD 2.0 Termfix update+UIctl update: enables cool features.
  • MobileTerminal: cmd.exe/console/Term for the iPhone
  • Categories+Poof: File iPhone icons in folders and clean them off the desktop.

iPhone: copying to and from a Computer

You will soon realize that synchronization options for the iPhone are (as yet) limited. You can sync music, and you can sync contacts and calendars as long as you use one of the supported apps on your computer. But, no files, no notes, no anything else.

The alternative is to move files back and forth. You can choose among several choices for doing this. I think all of them require jailbreaking (perhaps not iPhoneBrowser). In this list, the server is the software on the computer, and the client is the software on the iPhone:
  • iPhoneBrowser: completely server-controlled. Google iPhoneBrowser v1.6. I downloaded it from www.modmyiphone.com. Install and run. Connect your iPhone to your PC with the USB cable! You see an explorer-like view of your ~/Media directory.
    Pros: Easy, may? work with a normal un-jailbroken phone, controlled from your PC.
    Cons: Only works on Windows, doesn't show you all of your iPhone files, needs USB cable.
  • sendFile: completely client-controlled. sends files from your iPhone via e-mail. Available from iPhone Installer app.
    Pros: Easy. no USB cable needed. Sends any file. YAESSA (Yet Another Erica Sadun Super App).
    Cons: Must move file to specific place (~/Media/Documents), then go to e-mail to mail the file. Requires jailbreaking.
  • openSSH: uses the SSH network protocol to communicate between iPhone and computer. From there, you can use SCP to transfer files. Controlled either from client or from server.
    Pros: standard UN*X app. YAESSA (see above). complete control from either iPhone or computer. Supported by multiple platforms.
    Cons: complete control (yipe!) Hard to configure if you're not a UN*X guru. Must know hostname or IP address of server if you go from iPhone to PC, or IP address of iPhone if you go from PC to iPhone. Some networks block port 22 used by SSH.
    Notes: most OSes run the server daemon sshd for SSH during startup. openSSH dynamically loads it based on a trigger from inetd, which iPhone OS loads. So, don't worry about a drained battery.

Thursday, March 27, 2008

iPhone: password? We don't need no stinkin' password!

If you jailbreak and hack your iPhone, you may discover that your root password no longer works.

The default root password as of iPhone OS 1.1.4 is alpine. That's no secret at all, and if you worry about somebody hacking your phone you may want to change it. I'm still investigating that task.

Problem is, you may try alpine without success. I did!

What I learned is that installing some apps and libraries may cause problems with Terminal and other UIs that access the OS. If you have installed BSD 2.0, or some of the utilities that use it, you may find that alpine no longer works.

In that case, install the following:
  • BSD Term fix
  • SUID fix
The password will start working again.