koan
koan

Reputation: 3686

How can you scan an OSX binary for API usage?

I'm developing a Mac OSX application using OSX 10.8. I want to make sure that my application will run correctly on 10.7.

In my source I believe I am not using 10.8 specific API calls (but I could be mistaken). There are third party libraries that I link to that may use 10.8 specific API calls.

I don't have a test system for 10.7. How can I test such a binary (executable or library) to see if it should work on 10.7 or not?

Upvotes: 0

Views: 364

Answers (2)

Rob Napier
Rob Napier

Reputation: 299545

The first, best solution is to just compile with the 10.7 SDK. Then you know for certain that it will run on 10.7.

If that's not possible for some reason, then the best tools available are DeployMate and AppCode which can search for incorrect usage.

But I strongly recommend compiling with the SDK that you are targeting. See also Mac SDK: using latest SDK but ensuring backwards compatibility with earlier deployment target

See also https://gist.github.com/rnapier/3370649 for a script to assist in managing this.

Upvotes: 1

user1118321
user1118321

Reputation: 26395

If you have specific API you're looking for, you can use tools like otool and nm to see if a binary includes calls to those APIs. See the man pages of each for details on how they work.

Upvotes: 1

Related Questions