я боролся с этой концепцией на некоторое время, и я не могу понять, в чем разница между -change
и -id
.the человек страницы состоянийразница между install_name_tool -Изменить и -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
и когда я использую это?
Вы говорите, что мы используем -id, когда мы chnaging вещи на основной исполняемый файл внутри/Содержание/MacOS /? – MistyD
@MistyD Нет, вы бы использовали для этого '-change'. – trojanfoe
Так что я все еще смущен, когда использовать -обмен? У вас есть статья, которая может объяснить это. – MistyD