Configure Podlist
PodIs the IOS under the Package management tool, similar to JavaScript npm or yarn .
Create
Podfile
PodfileThere are two ways of creating:
- Open Terminal, in the root directory of the IOS project, to perform
touch Podfile
Or
- Open Terminal, in the root directory of the IOS project, to perform
pod init
Configuration
Podfile
A simplePodfile
target ‘MyApp‘pod ‘AFNetworking‘, ‘~>3.0.4‘ # AFNetworking 版本必须 >=3.0.4 并且 <3.1.0
A complexPodfile
Platform: iOS,' 9.0 '# Specify platform and version inhibit_all_warnings!# Global Suppress warning target' MyApp 'Do# Pods for Myapppod' Fabric ',' ~>1.6.0 '# Fabric version must be >=1.6.0 and <1.7.0pod' Objectivesugar ', ' >=1.0.0 ' # Objectivesugar version must >=1.0.0pod ' afnetworking ',' <=4.0 ' # afnetworking version must <=4.0 # Pods for testing target ' myapptests ' do # myapptests directory Reference inherit! : search_paths End # Pods for testing target ' myappuitests ' do # myappuitests directory Reference inherit! : search_paths endEnd
Install dependent packages
Note: To turn off Xcode first, you will not be able to generate Podfile.lock and xxx.xcworkspace files properly
Open Terminal, in the root directory of the IOS project, to performpod install
Reference documents
- http://www.jianshu.com/p/8af475c4f717
- Http://www.devzhang.com/14557860422170.html
You are welcome to help error correction, together to help more people. Learn to exchange react, QQ Group: 413381701
Starting from: https://github.com/Kennytian/learning-react-native
How to use IOS under Podfile