Archive for the ‘Xcode’ Category

Upgrading to Xcode 4.3

February 18th, 2012 5 comments

Xcode 4.3 was released on February 16th. It is now truly a Mac App Store application.

With Xcode 4.2, you downloaded an “Install Xcode” application from the Mac App Store, which in turn “installed” Xcode in the usual location, “/Developer”, which is a folder named “Developer” at the root of your hard drive.

Furthermore, if you wanted Xcode to automatically update (from the Mac App Store), you had to keep the “Install Xcode” application (1.8 GB) in your Applications folder, as that was what the the Mac App Store actually updated; you then had to run “Install Xcode” manually to update.

This has changed for the better. now installs directly in the Applications folder. In fact, it will helpfully propose to move the older, obsolete installation to the Trash for you:

Xcode move to Trash

Xcode is also smaller, since a lot of (probably) lesser-used software has moved to optional downloads. Peter Hosey has a comprehensive list.

In my case, I had one more thing to do: install the command-line tools. They can be found in Xcode > Preferences > Downloads > Components. To get them working properly, here is what I had to do:

  1. sudo xcode-select -switch /Applications/
    This updates the command-line Xcode tools to point to the new location, and is only important if you are migrating from 4.2. A new install should work fine.
  2. Install autoconf. Some of my projects (and many unix-based ones) use autoconf to generate ‘configure’ files, and this tool is missing from the new install. It was present in earlier installs, so I have filed a radar.
    In the meantime, I was able to download the latest version (2.84 at the time of this writing) and install it with the usual ./configure; make; sudo make install dance
  3. Update any scripts that have a hard-coded ‘/Developer’ path.
    Since everything is in the ‘/Applications/’ bundle, the new path is ‘/Applications/’. If you don’t want to hard-code it (for instance, if you use Xcode 4.3 but your colleagues are still on Xcode 4.2), you can use the output of xcode-select --print-path to find the path to ‘Developer’ on any system. This works in Xcode 3 as well.

Xcode 4.3 requires MacOSX Lion 10.7.3.

Categories: iOS, MacOSX, Xcode Tags:

Xcode 4.2 and older iOS devices

December 18th, 2011 3 comments

If you want to build software using the new default templates on Xcode 4.2, you have some work to do for older devices (anything that can’t run iOS 5).

For some unknown reason, the variable $(ARCHS_STANDARD_32_BIT), which used to expand to armv6 armv7 now expands only to armv7.

Furthermore, there is a new entry in the default Info.plist which will prevent Xcode from even uploading the binary to your device.

Finally, there are issues with the compiler’s ‘thumbnail generation’ code ‘Thumb code’ generation in Xcode 4.2. You can disable that compiler option for armv6 builds in Xcode.

I have a 2nd generation iPod Touch that I use daily. It runs iOS 4.2.1, the latest it will ever run. This is essentially the same hardware as an iPhone 3G in terms of capabilities.

I also have a 1st gen Touch, but it’s getting used less and less as I target iOS 4 as the earliest capable version. I’m not going to iOS 5 yet because my main device is still iOS 4.

When I create a new project, I use iOS 5 as the SDK and iOS 4.2 as the deployment target. In theory, this allows me to target all devices that can run iOS 4, which includes my beloved Touch.

To make this work properly, you will want to do three things:

  1. In your Project’s Build Settings, locate the “Architectures” line. It should say $(ARCHS_STANDARD_32_BIT). Edit it to contain two entries: armv6 and armv7.
  2. In your Project’s Info.plist, locate the entry for “Required device capabilities” and delete it.
    If you expand it, you will see that it contains only armv7.
  3. Bonus! Thanks to @jamesthomson, there are issues with clang-llvm 3.0 on armv6 devices.
    In your Project’s Build Settings, locate “Other C flags” and add “-mno-thumb” to the armv6 architecture.

When radar comes back online, I’ll file the bug (which will undoubtedly be marked “Duplicate”)

Categories: Development, iOS, Xcode Tags: