Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


oTool | 27 comments | Create New Account
Click here to return to the 'oTool' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
oTool
Authored by: bhines on Jul 05, '02 06:42:33PM
You can use "otool -L" to see what an app links against. Any app which links against AppKit+Cocoa.framework is Cocoa:
ben% otool -L /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal: /System/Library/PrivateFrameworks/AppSupport.framework/Versions/B/AppSupport (compatibility version 1.0.0, current version 52.0.0) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 7.0.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 16.0.0) /System/Library/PrivateFrameworks/HIServices.framework/Versions/A/HIServices (compatibility version 1.0.0, current version 64.0.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 217.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 226.0.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 619.0.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 423.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 55.0.0)
If otool fails, like:
ben% otool -L /Applications/Internet Explorer.app/Contents/MacOS/Internet Explorer /Applications/Internet Explorer.app/Contents/MacOS/Internet Explorer: is not an object file
It is a CFM app and is obviously not Cocoa. A Carbon Mach-O app would look like:
ben% otool -L /Tex-Edit Plus.app/Contents/MacOS/Tex-Edit Plus /Applications/Applications/Tex-Edit Plus 4.2.4 ƒ/Tex-Edit Plus.app/Contents/MacOS/Tex-Edit Plus: /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0) /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 142.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 55.0.0)
Note that many Cocoa apps also link Carbon:
ben% otool -L /Applications/Applications/Watson.app/Contents/MacOS/Watson /Applications/Applications/Watson.app/Contents/MacOS/Watson: /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 7.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 122.0.0) @executable_path/../Frameworks/GeneralTool.framework/Versions/A/GeneralTool (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/Message.framework/Versions/B/Message (compatibility version 1.0.0, current version 482.0.0) /System/Library/Frameworks/ExceptionHandling.framework/Versions/A/ExceptionHandling (compatibility version 1.0.0, current version 4.7.0) @executable_path/../Frameworks/CURLHandle.framework/Versions/A/CURLHandle (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 55.0.0)
However, Carbon Apps *CAN* use Cocoa stuff, If they load a Cocoa bundle dynamically. It is kinda tricky, but it was demoed at WWDC 2002. Pretty cool stuff.

[ Reply to This | # ]
Re: oTool
Authored by: Rosyna on Jul 06, '02 12:23:12AM

Right, and if a Carbon app links to cocoa, you'd get the same thing ;)

I have a few "Tools" that link to both CoreServices (carbon) and Foundation (Cocoa) Using the method described, people would think they are Cocoa.



[ Reply to This | # ]