Packaging Xcode 4.3

floatingmichael
New Contributor
New Contributor

There seem to be some significant changes to the way Xcode 4.3 needs to be packaged for deployment compared to earlier releases. I just helped a customer through this process and wanted to share our process:

1) Packaging Xcode.app:

Xcode 4.3 is distributed via either the App store, or via Apple's Developer portal as a DMG download. We had better success with the DMG download. Take a 'Normal Snapshot' with Composer, copy the Xcode.app into the Applications folder, Launch and proceed with any install prompts until you get to the normal Launch screen. Close your snapshot, check your sources, and Package as a DMG archive.

2) Packaging any Add-ons you want:

Within Xcode's preferences, there is an in-app downloads section. You might consider packaging these separately by using a 'New and Modified' Snapshot after Xcode has been installed. It seems the end-user doesn't need to be an Admin to install them (they just need an Apple ID with Developer access). So this seems to be optional.

3) Installing the Mobile Device Package:

I'm not sure why, but our Xcode.app snapshot didn't carry over the Mobile Device package that is a necessary addition for Xcode to run. This .pkg is actually located within Xcode.app, and can be installed as part of a larger Xcode install policy using a very simple 'after' script that executes this command:

installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target /

I suppose this could apply to any other .pkg's that show up in this path of future Xcode.app downloads.

4) Uninstalling any previous version Xcode version:

If you are upgrading from a previous version of Xcode that deploys a /Developer path, you will want to uninstall the previous developer tools and developer folder. Apple provides a perl script to help us with this. It should be run in a 'before' script:

/Developer/Library/uninstall-devtools  --mode=all

Otherwise just:

rm -rf /Applications/Xcode.app

That's it!

Hopefully this provides some helpful insight. I owe some credit to my friend Rich at Der Flounder http://derflounder.wordpress.com/2012/02/17/building-a-grand-unified-xcode-4-3-installer/ for some tips, especially on the uninstall scripts.

7 REPLIES 7

dlondon
Valued Contributor

Hi we struggled with this too over here on the West coast of Australia. What we ended up doing was a very minimalist system:

1) Download Xcode from the App Store
2) Using Composer - cancel out of the new package screen if it's there - drag the "Install Xcode.app" from Applications folder into Composer and click "Build as DMG". This is what we use to deploy the installer to each machine.
3) Then we have a BASH script that has the following:

#!/bin/bash

/usr/sbin/installer -pkg /Applications/Install Xcode.app/Contents/Resources/Xcode.mpkg -tgt /

/bin/rm -R /Applications/Install Xcode.app

exit $?

That script is set to run at reboot for imaging. I'm sure it could also be used in Application Deployment in any of the ways Casper allows it e.g. Remote or Policies.

Comment: So basically we don't modify the installer. We just take the App as provided by Apple, deploy it and then run it.

I'm no big Xcode user but certainly gcc and the GUI tools are working as expected.

Regards,

David

Kumarasinghe
Valued Contributor
installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target /

Does the trick for MobileDevice application install.

jarednichols
Honored Contributor

Just went through this and it worked except I had to force afp/smb distribution for the policy to work in Self Service. Unsure why.

bentoms
Release Candidate Programs Tester

@Jared.. I may well be wrong, but I thought there was a 4GB limit for installing apps over HTTP. No idea why I think that though. So is probably wrong!

rtrouton
Release Candidate Programs Tester

Ben,

I'm pushing AAMEE-built Creative Suite 5.5 and Xcode 4.3 installers via HTTP. No problems seen (just takes a while sometimes.)

bentoms
Release Candidate Programs Tester

Cool. I'm wrong then.

No idea where that thought came from. Sorry to mislead.

daworley
Contributor II

Follow up question:
If pushing Xcode via a Casper Imaging config, would one change the post install script to be something along these lines?

installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/MobileDevice.pkg -target $2

If not, could someone offer a sanity check?