创建 Podfile
vim Podfile
输入
platform :ios,'10.0'
target ‘name’do
pod "AFNetworking"
end
结束编辑
:wq!
ls
cd 项目(拖拽进来也行,注意路径)
觉得不放心 在 ls 看看是否正确
执行
pod install
======================
Podfile文件书写
#source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
# 忽略引入库的所有警告
inhibit_all_warnings!
target 'demoCS' do
pod 'AFNetworking'
pod 'AFNetworking', '~> 3.0'
end
普遍
# 下面两行是指明依赖库的来源地址
#source 'https://github.com/CocoaPods/Specs.git'
#source 'https://github.com/Artsy/Specs.git'
# 平台,版本
platform :ios, '9.0'
# 忽略引入库的所有警告
inhibit_all_warnings!
# 针对MyApp target引入AFNetworking
# 针对MyAppTests target引入OCMock,
target 'MyApp' do
pod 'AFNetworking', '~> 3.0'
target 'MyAppTests' do
inherit! :search_paths
pod 'OCMock', '~> 2.0.1'
end
end
# 这个是cocoapods的一些配置,官网并没有太详细的说明,一般采取默认就好了,也就是不写.
依赖
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git' //默认master
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :branch => 'develop'
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git',:tag => '0.7.0'
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :commit => '082f6719af'
pod 'AFNetworking', :path =>'/Users/XXXXX/XXXXX/XXXXX/AFNetworking'
pod 'JSONKit', :podspec => 'https://example.com/JSONKit.podspec'
网友评论