10.5: List 64-bit enabled GUI applications in 10.5

Mar 10, '08 07:30:00AM

Contributed by: wireface

Leopard added the ability to run 64-bit Cocoa, and to some extent Carbon, applications (it was possible to run non-Cocoa/Carbon 64-bit apps as of 10.4; for example, command line apps). But you might now be curious if any of your Cocoa GUI applications in Leopard actually are compiled to take advantage of 64-bit addressing. To find all Applications that are compiled for 64 bit is pretty easy. In Terminal, type either the Intel or PowerPC command below (the line without the leading #):

# For Intel:
locate -0 app/Contents/MacOS/ | xargs -0 file | grep x86_64

# For PowerPC:

locate -0 app/Contents/MacOS/ | xargs -0 file | grep ppc64
On my system, I had seven 64 bit GUI apps (all apple ones in fact: Xcode, Chess, Java, Quartz Composer,etc). Just to clarify a bit: A 64-bit application only means that that single application can access more than 4GB of memory (which is the 32-bit limit). It has nothing directly to do the with speed of the program, only how much memory it can address.

The Terminal commands above are just running the file command on all executable files. If you wanted to know all architectures for a single app (Xcode, for instance), then you could type:

file /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
This produces the following output:
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode: Mach-O universal binary with 4 architectures
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture ppc7400):  Mach-O executable ppc
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture ppc64):    Mach-O 64-bit executable ppc64
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture i386):     Mach-O executable i386
/Developer/Applications/Xcode.app/Contents/MacOS/Xcode (for architecture x86_64):   Mach-O 64-bit executable x86_64
[robg adds: For this hint to work, you'll need an up-to-date locate database. The routine maintenance scripts should take care of this problem, but if for some reason they haven't, you can create it yourself in Terminal with this command: sudo /usr/libexec/locate.updatedb. This will take a few minutes to run...]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=200803020843118