26

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
  • 78,473
  • 57
  • 200
  • 338
AMH
  • 6,363
  • 27
  • 84
  • 135
  • 3
    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

3 Answers3

16

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

and print example:

otool -MVv yourlib.a

for help:

otool --help
Alex Nazarov
  • 1,178
  • 8
  • 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
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
  • 12,492
  • 9
  • 66
  • 110
  • 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
0

On macOS, the otool tools is alternative to the objdump on the Windows. You should open Terminal and print example:

$ man otool  //Usage for otool

If you want to disassemble a file, Just type like this:

$ otool -tV filename