iOS   发布时间:2022-05-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了xcode – install_name_tool -change和-id之间的区别大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我一直在努力解决这个概念,我无法真正理解-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
我一直在努力解决这个概念,我无法真正理解-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
        |_@R_675_9214@library.dylib     --->item B
        |_another_library.dylib  --->item C

现在假设我在itemB上运行了以下命令

$otool -L @R_675_9214@library.dylib
   @R_675_9214@library.dylib
   /some/path/another_library.dylib  -->item D

上面的结果表明,如果我需要更改another_library.dylib的位置,@R_675_9214@library.dylib现在依赖于another_library.dylib我会这样做

install_name_tool -change /some/path/another_library.dylib some/new/path/another_library.dylib  @R_675_9214@library.dylib

这会改变项目D的位置.我的问题是install-name_tool -id做什么以及何时使用它?

解决方法

我的理解是:

-id:设置链接动态库时将使用的“安装名称”.它将在目标动态库文件上运行.

-change:这会在链接后更改“安装名称”,并将在链接目标动态库的可执行文件或动态库上运行.

大佬总结

以上是大佬教程为你收集整理的xcode – install_name_tool -change和-id之间的区别全部内容,希望文章能够帮你解决xcode – install_name_tool -change和-id之间的区别所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。