MacOS开发-为install_name_tool添加脚本
程序员文章站
2024-03-24 13:42:58
...
为编译添加install_name_tool
脚本,解决每次手动运行的繁琐
install_name_tool
的作用?
见 https://blog.csdn.net/shengpeng3344/article/details/102592191
添加一个新的脚本文件New Run Script Phase
由于Copy Files
设置的为Frameworks
路径,所以下面脚本都在Frameworks
路径处理,脚本内容为
#Copy Files ... replace to cp -r xxx.dylib
#改变dylib的引用地址,防止library/framewokr not found
mkdir -p "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks"
#cp -r "$SOURCE_ROOT/../GSFrameworks/osx-lib/lib/osx/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"
#libwebrtc
install_name_tool -id "@executable_path/../Frameworks/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libwebrtc.dylib"
install_name_tool -change "/usr/local/lib/libwebrtc.dylib" "@executable_path/../Frameworks/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
#libVlcFilePlayer
install_name_tool -change "/usr/local/lib/libVlcFilePlayer.dylib" "@executable_path/../Frameworks/libVlcFilePlayer.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "/usr/local/lib/libVlcFilePlayer.dylib" "@executable_path/../Frameworks/libVlcFilePlayer.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libRtRoutineOSX.dylib"
install_name_tool -change "$USER_LIBRARY_DIR/libwebrtc.dylib" "@executable_path/../Frameworks/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
#cp -r "$SOURCE_ROOT/../GSFrameworks/osx-lib/lib/osx/libSwfView.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"
install_name_tool -id "@executable_path/../Frameworks/libSwfView.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libSwfView.dylib"
install_name_tool -change "/usr/local/lib/libSwfView.dylib" "@executable_path/../Frameworks/libSwfView.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
#install_name_tool -change "$USER_LIBRARY_DIR/libSwfView.dylib" "@rpath/libSwfView.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
install_name_tool -change "$USER_LIBRARY_DIR/libSwfView.dylib" "@executable_path/../Frameworks/libSwfView.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
#cp -r "$SOURCE_ROOT/../GSFrameworks/osx-lib/lib/osx/libRtRoutineOSX.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/"
install_name_tool -id "@executable_path/../Frameworks/libRtRoutineOSX.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libRtRoutineOSX.dylib"
install_name_tool -change "/usr/local/lib/libwebrtc.dylib" "@executable_path/../Frameworks/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libRtRoutineOSX.dylib"
install_name_tool -change "$USER_LIBRARY_DIR/libwebrtc.dylib" "@executable_path/../Frameworks/libwebrtc.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/libRtRoutineOSX.dylib"
install_name_tool -change "@executable_path/libRtRoutineOSX.dylib" "@executable_path/../Frameworks/libRtRoutineOSX.dylib" "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME"
推荐阅读
-
MacOS开发-为install_name_tool添加脚本
-
linux下采用shell脚本实现批量为指定文件夹下图片添加水印的方法
-
Android开发实现布局中为控件添加选择器的方法
-
Android开发实现布局中为控件添加选择器的方法
-
为radio类型的INPUT添加客户端脚本(附加实现JS来禁用onClick事件思路代码)
-
linux下采用shell脚本实现批量为指定文件夹下图片添加水印的方法
-
为radio类型的INPUT添加客户端脚本(附加实现JS来禁用onClick事件思路代码)
-
Agora获5000万美元B轮融资 帮助开发者为应用添加语音视频功能
-
IOS开发技巧--如何使用lookup table为图片添加滤镜
-
Android画板开发之添加背景和保存画板内容为图片