I don't really see any reason why it wouldn't work. I think you would have to uninstall Xcode and then reinstall it, but choose to have Xcode's dev directories, program files, etc on the flash drive. I would also definitely recommend either a USB 3.0 flash drive, or a thunderbolt external 7200rpm HDD or SSD.