Developing remotely

Okay, not ‘truly’ remotely.  My dev box isn’t out in the desert, or sitting on the Moon.  It’s not even in a different room.  In fact, Winston the Mac Mini sits not two feet away from my normal laptop, lacking only his own monitor.  The default Snow Leopard installed makes it quite easy to turn on OSX’s Screen Sharing – essentially a slightly customised version of VNC.

After that, it’s a pretty easy task to use any VNC client to connect to and control the Mini.  Apple Remote Desktop seems to be inexplicably expensive when any client such as Chicken of the VNC (Mac) or TightVNC (Windows) will do, so I recommend steering well clear of it.  I chose to use TightVNC on my Windows laptop to connect, and it’s here that the issues begin…

To start with, VNC shares the whole screen.  Unlike the Remote Desktop natively built into Windows computers, which uses its heavy integration with Windows system to selectively update only the active areas of the screen when needed, VNC always updates the entire screen1, whether it needs to or not.  Over a wifi connection, this can chew up a lot of bandwidth for some choppy screen refresh rates, but for the purposes of just writing code it’s not too bad.  There’s a few milliseconds improvement in reaction time when I link the computers using Gigabit wired ethernet, so I tend to prefer that option when I can.

The next issue is directly related to Interface Builder on the Mac.  All the tutorials, all the early videos from CS193P say “Control-click and drag to connect interface elements to their actions.”  VNC does not allow ctrl+click+drag to be sent over the network.  No version of VNC will send simultaneous Ctrl+drag events.  It makes it quite difficult to follow tutorials in the beginning.  Luckily the Ctrl+drag functionality is not the only way to create  connection between the elements: A right click brings up a list of delegates/events for an interface element, and clicking and dragging the circle to the right of those events to the appropriate delegate objects allows me to link elements with Outlets, Events with Actions, delegates with responders etc.  At first, all these links were just confusing and all I wanted to do was follow the tutorial.  In retrospect though, I actually think it was a positive that I needed to learn about Actions, Outlets and Delegates before I could use them properly :)

Probably the most important issue is the lack of an Option key though.  Testing things like multitouch in the iPhone simulator requires holding down the Option key to create a ‘mirrored’ cursor.  This gets pretty difficult when there *is* no option key.  When attaching a Windows keyboard to a Mac, the Alt key becomes Option and the Windows key becomes the Apple key.  Over VNC however, the Alt key is the Apple key (because it’s in the same location as the Apple key on the keyboard), but the Windows key….well, it’s still the windows key.  So for the moment testing multitouch is done by attaching my keyboard directly to the Mac.

Overall, writing code using XCode over VNC is slow and there’s a few small issues to get over – but overall it’s a lot cheaper than buying a separate monitor, and all the problems with it so far can be overcome with a bit of ingenuity.

5 thoughts on “Developing remotely

  1. I've been struggling with the lack of Control-Drag over VNC for a while. I'd tried everything, except right clicking on the target of the drag. Thanks!

  2. If you press scroll lock using UltraVNC it makes the Windows key work as the Apple Key, if you want to regain the windows key functionality, you can get it by pressing scroll lock again.

  3. This is wonderful. I thought I hit another dead end by using TightVNC. The right click is a great option. I knew both right click and control drag when I went through tutorial on Mac but I didn’t know they were doing the same thing. Good to know. Thanks for the post.

  4. Thanks, I’ve just started iphone dev using a remote mac ‘time sharing’ option (I can buy a LOT of time (as in years) for the price of even a mac mini) but it uses vmc and I was having the same problem. You have just saved my sanity!

  5. Hi,
    How can you do an Outlet Collection with this right click method (I’m referring to slide 72 of lecture 3 of CS193p… 😉
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *