-change
私はしばらくの間、この概念に苦労してきましたが、との違いが本当に理解できません-id
。
-id name
Changes the shared library identification name of a dynamic shared library to name. If the Mach-O binary is not a dynamic
shared library and the -id option is specified it is ignored.
-change old new
Changes the dependent shared library install name old to new in the specified Mach-O binary. More than one of these options
can be specified. If the Mach-O binary does not contain the old install name in a specified -change option the option is
ignored.
これまでのところ、私は で実験しまし-change
た。次の構造があるとします
Test.App
|_Contents
|_MacOS
| |_test -----> item A
|_Library
|_test_library.dylib --->item B
|_another_library.dylib --->item C
ここで、itemB で次のコマンドを実行したとします。
$ otool -L test_library.dylib
test_library.dylib
/some/path/another_library.dylib -->item D
上記の結果は、場所を変更する必要があるかどうかに応じて、test_library.dylib
これを行うことを示していますanother_library.dylib
another_library.dylib
install_name_tool -change /some/path/another_library.dylib some/new/path/another_library.dylib test_library.dylib
これにより、アイテムDの場所が変更されます。私の質問は、何install-name_tool -id
をし、いつそれを使用するのですか?