22

apple suggested me to use "strings" or "otool" to dect the private api (isinf) in my code , I am totally newbie so any help how to use those tools

Andrew Grimm
  • 70,470
  • 47
  • 186
  • 310
AMH
  • 5,779
  • 27
  • 75
  • 132
  • 2
    Duplicate of http://stackoverflow.com/questions/1229018/whats-the-trick-to-use-otool-on-the-mac, http://stackoverflow.com/questions/2842357/how-does-apple-know-you-are-using-private-api and http://stackoverflow.com/questions/1863764/how-to-detect-avoid-the-use-of-private-apis-in-third-party-libraries – Chetan Bhalara May 10 '11 at 07:48

2 Answers2

13

I use nm to inspect my binaries. Usage can't be simpler:

 nm <filename>

It will list some weird memory-address or whatever, then a visibility character and lastly the symbol. T is public, but check out the man page of nm to find out more about this.

Press Ctrl+space to open up the terminal.

vidstige
  • 11,161
  • 7
  • 58
  • 95
  • 2
    could you give me more details – AMH May 10 '11 at 07:50
  • you know how to start up a terminal? Just type "nm" and then you binary and you will see a long list of symbols. You can then grep for stuff like so "nm | grep isinf" – vidstige May 10 '11 at 08:06
13

Open Terminal ( Ctrl + Space -> Type 'Terminal')..

and print example:

otool -MVv yourlib.a

for help:

otool --help
Alex Nazarsky
  • 969
  • 7
  • 16
  • 4
    This set of parameters are no longer supported by otool. Would you care to explain what did they mean? – leolobato Dec 20 '16 at 14:16
  • @leolobato according to the documentation, `-M` used to "print the module table of a dynamic shared library" – lukas Feb 17 '19 at 15:39
  • FYI: `warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: -M functionality obsolete OVERVIEW: llvm object file dumper` – Abbey Jackson Apr 25 '19 at 19:36
  • You can use `otool -tvV` or `nm` to get some private info – Abbey Jackson Apr 25 '19 at 19:38