blob: 16005c4c6322a481648c2fa7cea1b995c838a78f [file] [log] [blame]
'ndk-depends' Overview
The `ndk-depends` tool that comes with this Android NDK allows you to dump
the ELF dependencies of a given ELF shared library or executable.
With the --print-java option, it can also be used to generate a Java
source fragment to load your native library and its dependencies in the
correct order (see example below).
Use '`ndk-depends --help`' for complete usage information.
This tool is designed to support:
- Either 32-bit or 64-bit ELF binaries.
- Either little-endian or big-endian ELF binaries.
- Unicode file paths, on Windows.
Note: The Windows binary will NOT work with Cygwin paths !
* `ndk-depends path/to/`
> Dump all dependencies of, in topological order, so
that any library listed in the result appears before any other
library it depends on.
* `ndk-depends --print-paths path/to/`
> Same as above, but also prints the path of the libraries on
your host file system.
* `ndk-depends -L some/other/path path/to/`
> Append 'some/other/path' to the search path for depending libraries
when looking at the dependencies for ''
* `ndk-depends --print-direct path/to/`
> Only print the _direct_ dependencies of, and nothing
else, in the order they appear in the file.
* `ndk-depends path/to/ --print-java`
> Prints a Java source fragment that corresponds to the load
of 'libfoo' with System.loadLibrary(). This lists all libraries
in reverse order, and ignores system libraries (e.g.
* `ndk-depends path/to/ --print-dot | dot -Tpng -o /tmp/graph.png`
> Prints the dependency graph as Graphviz .dot file, then generate
a PNG image for it.
* `ndk-depends --help`
> Print complete usage details.
Let's assume your project has the several libraries: -> depends on and -> depends on the system's -> depends on
Then '`ndk-depends libs/armeabi/`' will typically print:
And '`ndk-depends --print-java libs/armeabi/`' will print:
This is handy to avoid computing the reverse library order yourself
for complex projects.
For more details, see the output of '`ndk-depends --help`'.