原 将uniapp HBuilder-UniPluginDemo转成cocoapods
版权声明:本文为博主原创文章,请尊重他人的劳动成果,转载请附上原文出处链接和本声明。
本文链接:https://www.91mszl.com/zhangwuji/article/details/1428
前提是安装好cocoapods,如果没有安装,参考:https://www.91mszl.com/zhangwuji/article/details/1427
我这里使用的环境:xcode 14.2,cocoapods 1.12.0
一:下载uniapp 官方的SDK,下载地址:https://nativesupport.dcloud.net.cn/AppDocs/download/ios.html#
cd /Users/zxb/Desktop/SDK/HBubilder-unipluginDemo
执行命令
pod init
然后会在HBubilder-unipluginDemo目录下生成一个Podfile的文件,里面的内容为
然后我们在里面添加内容如下
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
#忽略pod所有库警告
inhibit_all_warnings!
workspace 'zxbPlugin'
#关闭所有pod库的BITCODE
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
target 'HBuilder' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for HBuilder
end
2.1)创建工程目录
cd /Users/zxb/Desktop/SDK/HBubilder-unipluginDemo
mkdir zxb-plugins
2.2)创建工程
cd zxb-plugins
pod lib create mszl-notice
2.3)按照提示输入信息
2.4)然后切换到 HBubilder-unipluginDemo目录下
cd /Users/zxb/Desktop/SDK/HBubilder-unipluginDemo
vim Podfile
在里面添加内容
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
#忽略pod所有库警告
inhibit_all_warnings!
workspace 'zxbPlugin'
#关闭所有pod库的BITCODE
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
target 'HBuilder' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for HBuilder
pod 'mszl-notice', :path=>'./zxb-plugin/mszl-notice'
end
最后执行命令
cd /Users/zxb/Desktop/SDK/HBubilder-unipluginDemo
pod install
2.5)此时我们会看到在HBubilder-unipluginDemo目录下多了zxbPlugin.xcworkspace这个文件,我们双击就可以在xcode中打开了
2023-03-20 12:19:51 阅读(872)
名师出品,必属精品 https://www.91mszl.com
博主信息