Why unable to find utility "otool"?

[with Macos 10.9.5 on MacBookPro]

I'm fairly fluent in command-line unix, but the following dialog makes no sense to me at all:


[summer:/usr/bin]68 bobw% which otool

/usr/bin/otool

[summer:/usr/bin]69 bobw% ls -l otool

-rwxr-xr-x 1 root wheel 14224 Jan 23 2014 otool

[summer:/usr/bin]70 bobw% file otool

otool: Mach-O 64-bit x86_64 executable

[summer:/usr/bin]71 bobw% pwd

/usr/bin

[summer:/usr/bin]72 bobw% otool -L /usr/local/lib/libexpat.1.5.2.dylib

otool: error: unable to find utility "otool", not a developer tool or in PATH


Can someone please explain to me why I am unable to find/execute the `otool` command?

MacBook Pro, OS X Mavericks (10.9.5)

Posted on Nov 10, 2014 8:06 AM

Reply
6 replies

Nov 13, 2014 6:26 AM in response to disguise

Yes, /usr/gin is on my path envvar (as implied by `which otool` giving the expected response.) And, of course, I've tried all the variations: /usr/bin/otool, cd'ing to /usr/bin and using ./otool or just otool -- all garner the same result.

As I said, it makes no sense at all to me in the context of unix/linix --Apple must be implementing some special method to enforce use of "Developer's tools."

Nov 13, 2014 8:56 AM in response to rmwohlhueter

The /usr/bin/otool file is a "developer shim" the real command line tool is located within a particular Xcode package.


Do you have Xcode installed?

(I'm not sure if you can install the command line tools without installing Xcode.)


You may have multiple versions of Xcode installed, you then use xcode-select to point to the actual executables.


Read the man page for xcode-select


When I run 'otool' with no arguments I get the following usage statement


Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ usr/bin/otool [-arch arch_type] [-fahlLDtdorSTMRIHGvVcXmqQjC] [-mcpu=arg] [--version] <object file> ...

-f print the fat headers

-a print the archive header

-h print the mach header

-l print the load commands

-L print shared libraries used

-D print shared library id name

-t print the text section (disassemble with -v)

-p <routine name> start dissassemble from routine name

-s <segname> <sectname> print contents of section

-d print the data section

-o print the Objective-C segment

-r print the relocation entries

-S print the table of contents of a library

-T print the table of contents of a dynamic shared library

-M print the module table of a dynamic shared library

-R print the reference table of a dynamic shared library

-I print the indirect symbol table

-H print the two-level hints table

-G print the data in code table

-v print verbosely (symbolically) when possible

-V print disassembled operands symbolically

-c print argument strings of a core file

-X print no leading addresses or headers

-m don't use archive(member) syntax

-B force Thumb disassembly (ARM objects only)

-q use llvm's disassembler (the default)

-Q use otool(1)'s disassembler

-mcpu=arg use `arg' as the cpu for disassembly

-j print opcode bytes

-C print linker optimization hints

--version print the version of /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ usr/bin/otool

Jan 4, 2015 8:07 PM in response to rmwohlhueter

I was able to fix this problem by changing DYLD_LIBRARY_PATH


e$ otool

sh: line 1: 58039 Trace/BPT trap: 5 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/ SDKs/MacOSX10.10.sdk -find otool 2> /dev/null

otool: error: unable to find utility "otool", not a developer tool or in PATH

e$ xcode-select

dyld: Symbol not found: _sqlite3_intarray_bind

Referenced from: /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData

Expected in: /usr/local/lib/libsqlite3.dylib

in /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData

Trace/BPT trap: 5

e$ echo $DYLD_LIBRARY_PATH

/usr/local/lib

e$ export DYLD_LIBRARY_PATH=

e$ echo $DYLD_LIBRARY_PATH


e$ otool

Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ usr/bin/otool [-arch arch_type] [-fahlLDtdorSTMRIHGvVcXmqQjC] [-mcpu=arg] [--version] <object file> ...

-f print the fat headers

-a print the archive header

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why unable to find utility "otool"?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.