JUnitLaunchFixer 1.0.4 Released

I’ve just released a new version of my Eclipse plugin called JUnitLaunchFixer. If you’ve never heard of it, it lets you set the default heap size for new debug launchers in Eclipse. You can read more about it in the original announcement. This new version fixes a bug that caused it not to accept new parameters in one case, and it also adds the ability to set a default for the maximum permgen size, which is something I’d been wanting to add for a while.

If you already have it installed, go to Help>Check for Updates in Eclipse, and you’ll see it. If you don’t have it installed, the update site is here:

http://junitlaunchfixer.googlecode.com/svn/trunk/JUnitLaunchFixer-update-site/

 

Two Features To Make Lion’s Launchpad Perfect

One of the features in Lion that I didn’t think I would like has become one of my favorites: Launchpad. This is essentially Springboard from iOS, but for the Mac. It’s a nice iOS-like view of your /Applications folder, that you can get to by pinching on your trackpad using your thumb and three fingers. Once it opens, you see all your installed applications, with multiple pages, just like in iOS. Swiping left and right with two fingers switches between pages. Single-clicking an app runs it. Holding down Option makes the icons “go wiggly,” so you can move them around, just like in iOS.

The main problem is that you have to move apps around just like on iOS: one at a time. It makes sense on a touchscreen to only let you move one thing at a time, but on a traditional computer, it’s a limitation. My first suggested feature, then, is Apple should add the ability to select groups of icons and move them between pages as a group. It might also be nice to have a “consolidate” option that would just squeeze the apps onto as few pages as possible.

Which brings me to the second feature I’d like to see: pre-defined sort options. I like to have icons show up in alphabetical order, so having a menu option to “Sort Ascending” or something like that would be nice. I can also see something like sorting by most-recently used, so the apps you have recently used show up first. Or maybe a most-used sort, so those apps you use the most are at the top of the first page. Of course, they need an “as arranged” option so they show up how you arrange them.

These should be easy additions, and Apple should have already thought of them. I hope they will be in an update soon.

My Lion “Clean Install” Saga

Updated! Scroll down for the latest.

I upgraded my 2011 Macbook Pro and my 2006 Mac Pro to Lion on Day 1. The MBP has had no problems at all. The Mac Pro, on the other hand, was acting a little squirrelly. For example, after installing Xcode 4.1, iTunes could no longer see my iPhone or iPad when I attached them. Looking in Console, I saw errors about trying to start usbmuxd, but not being able to find it. This is because /System/Library/PrivateFrameworks/MobileDevice.framework had been gutted. Only a few files were left, none of which were the files in question. I could tell when they went missing from looking at the Time Machine backups, and it was the Xcode 4.1 installer’s fault. Xcode 4.1 also crashed on startup, every time. I had also been having some strange goings-on between my AppleTV and iTunes. All in all, I figured maybe a clean install was warranted. After all, I have never done one. I bought this machine new in 2006, and it came with Tiger. I then upgraded to Leopard, Snow Leopard and now Lion.

So I made a bootable Lion disc this morning, booted from it, repartitioned my hard drive and then started the install. It took a while. Finally, it asked me if I wanted to transfer data from another machine or from a Time Machine backup. I selected Time Machine, picked the backup to restore from, and then unselected the stuff I didn’t want to come over. I noticed that ~/Library was not shown, so I assumed that meant it would not be restored. I was wrong. Once I got into the system, I could tell that ~/Library had been restored. That meant that a good deal of the cruft I was hoping to cleanse was now back. So I started the whole process over again.

This time, when it asked if I wanted to transfer/migrate/restore, I said “no.” I ended up at a clean desktop, with no customizations, just like you would expect. I started restoring things from Time Machine, starting with my iTunes library. I have over 230GB of stuff in iTunes, so when it was finished, and I tried to open iTunes, I was a bit shocked when it said it couldn’t open the iTunes folder because it was on a locked volume. Clearly it wasn’t, but something was up. I ended up finding a command that seemed to fix this, but I also noticed that the gid on some of the files was wrong. So I typed

sudo chown -R jgibson:staff .

and shortly thereafter, iTunes was happy. But then I tried to restore my Documents folder. It got through a few of them, and then died with a similar message. Upon closer inspection, I could see part of the problem: the group id (gid) of all of my files in the backup was 501, but my current gid was staff (20). The group 501 doesn’t exist on this system (that’s a relic of a previous OSX version), so I figured I could just chgrp the files and all would be fine.

Except it wasn’t. As root, I was able to change most of the files and directories to have the proper gid, but some just responded with “operation not permitted.” That’s it. No further explanation about why or what to do about it. This was probably the crux of my problem, but I couldn’t fix it, even as root. I scoured the web, looking for answers, and found several, like ensuring the uchg flag is not set. I did so, but the problem persisted.

Next I decided to create a group that had 501 as its gid and add myself to it. Once I did this, the files in the backup volume now showed the new group’s name instead of 501. I thought I was home free. I was wrong.

I tried to change the gid of the files, but couldn’t. I figured I would need to logout and back in, since group changes usually require that on a Unix-y system. I did so. And then I noticed something else. None of the changes I had made to preferences or the dock had persisted. I use a Microsoft keyboard, so I had swapped the values of the Command and Option keys; they had reverted. I had removed Photo Booth from the Dock; it was back. I had changed the settings for Terminal and chosen “use settings as defaults;” the defaults had defaulted to their defaults.  Something else was definitely going on. After spending a few hours trying to find anything that looked possible, I gave up. I decided to start yet another install, and pay close attention to see if there’s something I missed. Perhaps when I first tried to restore from Time Machine, I ended up bringing across some bizarro setting that caused the whole thing. I don’t know. I’m frustrated and concerned and really tired of messing with this stupid thing today. This is not how I planned to spend my Saturday.

Dear Steve, this is not cool. I have no idea what’s going on here. Why the f@*k should I not be able to restore from Time Machine and have it set permissions properly? Why the f@*k should I see messages telling me what happened, but not why or what I might do about it? Why the f@*k should iTunes think it was on a locked disk when it wasn’t?

I will keep updating this post as my latest install progresses…

23:45 Update: I did a third clean install and everything seems to be OK. At first my preferences were not being saved, just like before, but after a couple of logouts/reboots, it occurred to me that the installation DVD was still in the drive. I took it out and rebooted, and now things were working as expected. I can’t prove it, but it seems to me that the system was booting from the DVD, even though it didn’t appear to be. Or just the presence of the install DVD caused the OS to mount the main drive “differently.” I can’t say, but removing the DVD seems to have fixed the problem.

Once I realized that preferences and settings were getting saved and survived logouts/reboots, I started restoring from Time Machine. Rather than trying to do several directories at a time (Documents, Pictures, Music, Movies, etc.) I did them one at a time, verifying things once each restore was complete. I got none of the “operation not permitted” or “can’t copy because you can’t read the files” errors, which was a nice change.

After restoring my Music folder, I updated iTunes to the latest version and ran it. It came up fine, found my library and everything was fine.

Since I’m running up against my draconian Comcast bandwidth cap, I tried to copy things from my MBP where possible, rather than download them. I was able to copy several gigabytes of stuff over, which was nice. I was a bit worried that I wasn’t going to be able to copy the “Install Xcode” package, because when I tried, I did get the “you can’t read this” error. I had set everything to what I thought was proper, but still no go. So I tarred the whole package up and copied that. I untarred it on the Mac Pro, then from Terminal, I went into the package to inspect. Instead of a gid of “staff” it was “admin.” I did a chgrp on all the files in the package, and then ran it. It installed without a hitch and at the end, Xcode fired up just like it should.

The real test was did it destroy the MobileDevice.framework directory like it had before. Covering my eyes, I navigated to the directory and took a peek: everything was there! So then I plugged in my iPad and Xcode saw it, iPhoto saw it and iTunes saw it. The trifecta, w00t w00t!

I did end up having to reinstall iWork ’09 from DVD, and I had to reinstall iPhoto from the app store, which meant a 700MB download, but that was the only one.

So, if you decide to do a clean install for Lion, make certain your backups are good and once it seems to have finished installing, and dumps you to the Finder, don’t believe it! Eject the DVD and reboot.

OSX Lion To Lion File Sharing Not Working – How To Fix It

After upgrading both my Macs to Lion on Wednesday, I discovered this morning that I can no longer mount shared folders between them. I tried going in both directions, and both failed with a very non-intuitive “Connection failed” message. I went to Preferences, Sharing, File Sharing and tried turning it off and on again, but to no avail. I then tried googling for the problem and saw lots of people with the same situation, but this one guy hit upon the “solution” to get it going. You have to turn off AFP sharing, and just leave Windows sharing on. Here’s the original answer. To summarize:

  1. Go to Preferences
  2. Click on Sharing
  3. Click on File Sharing on the left-hand side
  4. Click the Options button
  5. Uncheck “Share files and folders using AFP”
  6. Check “Share files and folders using SMB (Windows)”
  7. Click the Done button.

At this point, you should be able to connect from the other machine. If you need to go in the other direction, perform these same steps on the other machine.

Steve, please get this fixed ASAP, OK?

Xcode 4.1 Not Installing? Try This.

Apple released OSX Lion earlier today, but Xcode 4.0.2 is not compatible with it. Later in the day, they released Xcode 4.1 for Lion through the Mac App Store. I saw some comments from people saying that at about 80% of the way through the installation, they got a popup telling them they needed to quit iTunes in order to continue, but iTunes wasn’t running. They were unable to continue.

Here’s what they missed: iTunesHelper. This is an additional iTunes process that is running, even when iTunes proper is not. It’s there so that when you attach an iOS device, it can fire up iTunes for you.

Go into Activity Monitor and find iTunesHelper. Select it, and then kill it. After a second or two, the “you need to quit iTunes” dialog will go away, and the installation will complete.

Make a Copy of the OSX Lion Installer BEFORE You Run It!

If you’re planning on downloading OSX Lion from the Mac App Store and installing it on multiple Macs, heed my warning to make a copy of the .dmg file before you actually install it. I learned the hard way this morning that once the install is complete, it deletes the installer. That’s a 4GB file, by the way. And it’s not in the trash can; it’s completely gone. If you fail to make a copy of it, as I did, your only option, apparently, is to re-download it on your other Macs. Which is fine, unless you are a Comcast customer with a bandwidth cap and a draconian exceed-the-cap-twice-in-six-months-and-we-cut-you-off-completely plan. I accidentally exceeded the cap last month for the first time, so I’m extremely conscious about my usage now. I’m pissed that I need to re-download a 4GB file.

Steve, you have failed me. It is asinine to automatically delete a file so big without asking me. I understand that some people are short on disk space, and may not want that big file hanging around, but for those of us who have lots of space available, let us decide whether to delete it or not.

Google Chrome Sync Not Working? Try This

I use Google Chrome exclusively as my browser on both Mac and Windows, and I pretty much love everything about it. One of the things I love most about it is the ability to sync most of your settings between machines. This includes bookmarks, apps, themes, passwords, etc.

But the last three times I’ve done an install of Chrome on a machine (my friend’s loaned MacBook, my new MacBook Pro, and a Windows7 VM), when I entered my email address and password, I was told by Chrome that syncing was not available on my Google Apps account. Hmmmmm….

I don’t have an @gmail.com Google account, I have my own domain and a Google Apps account. While Google is trying to make Apps accounts and regular Gmail account identical, there are still some differences (like no profiles…). This can be frustrating, and I assumed that somehow my existing machines had been grandfathered in, but new ones were being excluded. (Also, both the Google Voice and GV Mobile+ apps on my iPhone failed to let me login, complaining about my email address or password being wrong.)

Then yesterday I noticed a comment on a forum (somewhere) suggesting a password mismatch between Google services might be to blame. I decided to give it a shot, so I went into my Google account settings and changed my password. Then I tried to enable sync on my MacBook Pro. BLAMMO! It worked. Then I enabled it on the Windows7 VM. Worked there, too. Then I tried to login using both the Google Voice and GV Mobile+ apps on my iPhone and both now allow me to login.

So, if you are having problems with a Google service or app, such as being told it’s not enabled for your apps account, or getting login failures, try changing your password.

GV Places 1.1 Submitted To App Store

Yesterday, I submitted version 1.1 of GV Places to the App Store for review. I am hopeful that it won’t take as long to get through this time, but I’m not holding my breath.

The biggest news is that I dropped the iOS target version, so now people with Verizon iPhones can run it. I had hoped that the app store would not let someone download an app that they couldn’t run, but based on the 1-star review I got from a Verizon owner, that may not be the case. Here are the release notes

  • Should now work on Verizon iPhones.
  • Fixed a sorting/display bug that occurred when a place was autoswitched. The next time the app was run, the list would not be sorted properly.
  • Improved the region detection on iPhone 4. This should properly handle overlapping regions, which worked fine on the 3GS, but not so much on the iPhone 4.
  • Fixed a couple of memory leaks.
  • Note that when autoswitching is turned on, the app is not constantly running, looking for location changes. On the iPhone 4, it uses the region monitoring API, which means it tells the OS the regions it is interested in, and then goes to sleep. Whenever the phone enters one of those regions, the OS will wake the app up, telling it that it entered that region. This uses no extra battery on my iPhone 4, that I could tell. On the 3GS, it uses the significant location change monitoring API. With this API, the app tells the OS it is interested in significant location changes (this is mostly when cell towers change), and then goes to sleep. When one of these events occurs, the OS wakes the app up, telling it that a significant location change has occurred. The app then gets the current location and sees if it is within one of your places. If it is, it switches to that place. This is not as accurate as on the iPhone 4, but it’s all the 3GS has. This would probably use up a bit more battery than on the iPhone 4, because it has to do more work, but I didn’t notice any significant battery degradation on my 3GS.
  • Also note that autoswitching of places is NOT supported on the iPhone 3G, because neither of the APIs I described above were available on the 3G. Everything else works on the 3G.

Downgrading Your iPhone From iOS5 to iOS4.3.3: It Ain’t Easy

Like lots of other iPhone owners, I was excited about the announcement on Monday of iOS5, and all the new features. I don’t like to wait and since it isn’t going to be released until September, I had to get it somehow. Since I’m an iOS developer, I was able to download a developer seed of iOS5 and install it on my iPhone 3GS. I did so Tuesday morning.

It was painfully slow on the 3GS. Granted this is just beta 1, and it will probably improve before it launches, but it was nearly unusable.

So today, I went out and bought an iPhone 4. I had been wanting one for a long time anyway, and my contract was up in February so I’ve been able to get a subsidized price since then… Anyway, I bought a 4, and was not planning on putting iOS5 on it just yet. But when I attached it to iTunes and tried to restore my last 3GS backup to it, iTunes wouldn’t let me because the backup was of iOS5 and the iPhone 4 was running 4.3.3. So, against my better judgment, I installed iOS5 on it.

Big mistake.

While speed was no longer an issue, bugginess was. Lots of 3rd-party apps just seemed to not work right, and even some features of iOS were a bit squirrelly. A downgrade was in order. But, as the release notes tell you, you can’t downgrade.

Well, you can, but it’s a major pain in the butt. Below is a list of what I did to restore mine. But first, please be aware that your mileage may vary, use at your own risk, by reading this, you agree that I am not liable for any damage to your iPhone, iTunes, data, computer, house, car, cat, dog or anything else.

(This is in list form, but it’s not an instruction list, per se. It’s a list of what I did, thus the verbs are in the past tense.)

  1. Restored the entire ~/Library/Application Support/MobileSync/Backup directory from Monday, before I did the upgrade of the 3GS, using Time Machine. (On Windows, the directory is C:Users<UserName>AppDataRoamingApple ComputerMobileSyncBackup)
  2. Downloaded the iOS 4.3.3 software image from links here (the links go to Apple) http://osxdaily.com/2011/05/04/ios-4-3-3-download/
  3. Launched iTunes, but hit the little ‘X’ button in the top area to stop it from syncing.
  4. Selected the iPhone 4 in the Devices section, then pressed Option while clicking on the “Check for Update” button. This popped up a dialog to find the .ipsw file that I had downloaded. I navigated to where I had saved it, and selected it.
  5. iTunes started to restore it, then barfed with one of those “unknown” errors. It did leave the iPhone in recovery mode.
  6. Out of paranoia, I shut down iTunes, deleted the partial backup that it had tried to do, thus leaving the Backup directory as it was on Monday.
  7. Started iTunes.
  8. iTunes popped up a dialog saying that the phone was in recovery mode and did I want to restore it. I said “yes.”
  9. It then showed me the EULA for 4.3.3, re-downloaded the .ipsw, then started the restore.
  10. Ten minutes later, it rebooted and showed up in iTunes, with iTunes asking if I wanted to restore it from one of my backups.
  11. I selected the 3GS backup and off it went.
  12. When the phone rebooted, iTunes started re-syncing it.
  13. Half an hour more, and it was done restoring all my data and settings. Then it started restoring 4,500 songs, which takes about 3 hours.

So, that’s it. All in all, it took me about 2 hours, start to finish. If you don’t have a backup of the Backup directory, you’re screwed.

I use pre-release software all the time, but this is the first time I’ve really, truly, gotten burned by it. I have now learned my lesson, and will at least wait for the release of iOS5… beta… 3 before trying again. 🙂