iPhone and Linux

Tuesday, July 21, 2009

Redo: Backup your SpringBoard icon arrangement

My last post about backing up the Springboard arrangement works fine, but if you view the backup file with iFile, the formatting is really messed up and you'd be amazed that it still works.

I initially thought this had something to do with the "cat" command. Since cat is a unix utility, maybe the Mac style carriage returns were messing it up. I changed the script to "cp" (copy) instead, but the output still had formatting problems.

I finally found that it is a problem with iFile. Renaming the file with a .plist extension makes it display normally.

I don't think it matters, but copying the plist to another plist is probably the better way of doing it.

#! /bin/sh
cp /var/mobile/Library/Preferences/com.apple.springboard.plist

#! /bin/sh
cp /var/mobile/springboardbackup.plist /var/mobile/Library/Preferences/com.apple.springboard.plist

Wednesday, July 15, 2009

iPhone: Backup your SpringBoard icon arrangement

I use a small icon theme called Matte Nano, plus fiveIrows and fiveIcolumns, so I can have as many as 25 icons per page on SpringBoard.

Sometimes the phone enters safe mode after a respring. This turns off all themes and customization and SpringBoard goes back to a 4x4, 16 icon arrangement. Respringing will take it out of safe mode, but the icons will still be in a 16 per page arrangement, and if you had more than 16 on a page, the extras will be scattered all over the place.

The icon arrangement is stored in /var/mobile/Library/Preferences/com.apple.springboard.plist, so I wrote two scripts, one to back up that file, and another to restore it.

To back it up, simply cat the file and redirect the output to a backup file

#! /bin/sh
cat /var/mobile/Library/Preferences/com.apple.springboard.plist > /var/mobile/springboardbackup

To restore, just cat the backup and redirect the output to the original. Everything will be back to normal after a respring.

#! /bin/sh
cat /var/mobile/springboardbackup > /var/mobile/Library/Preferences/com.apple.springboard.plist

To use: save these files as backupsb and restoresb, do a chmod 775 on both, and run them in MobileTerminal when needed.

Tuesday, July 14, 2009

Cydia crashes

A lot of people have been having Cydia crashes lately, most often while attempting a package upgrade that fails. The symptom is that Cydia will crash almost immediately after opening.

I had that problem and traced the issue to corrupt files in /var/lib/dpkg/updates/. Removing all files in that directory solved the problem for me and for several other people on the MacRumors iPhone forum. There have been people whom this didn't work for as well, but it's worked for more than it's failed, and it won't hurt anything to try if you're suffering Cydia crashes.

Here are a few methods for deleting those files.

Open MobileTerminal on the phone and type "rm /var/lib/dpkg/updates/*" (without quotes) and hit enter.

SSH into the phone and type "rm /var/lib/dpkg/updates/*" (without quotes) and hit enter.

Use the apps iFile or Discover from Cydia to browse to /var/lib/dpkg/updates/ and swipe the files then select delete, or in iFile select edit, check all the files, then tap the trash can at the bottom.

If you don't have MobileTerminal, SSH, iFile or Discover installed, you obviously can't install them through Cydia if it is crashing. You may try installing them through Icy, if you have that installed.

I'm sure there are other ways of doing this, but I'm currently unaware of them.

Blog Archive