iOS包管理工具

1,411 阅读1分钟

CocoaPods

 $ pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
                    Podfile.lock
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Setup the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock

Options:

    --silent        Show nothing
    --version       Show the version of the tool
    --verbose       Show more debugging information
    --no-ansi       Show output without ANSI codes
    --help          Show help banner of specified command

安装CocoaPods

 gem sources --a https://gems.ruby-china.com

 sudo gem install cocoapods
 
 pod setup

podspec文件

pod  spec create your_pod_spec_name

配置文件 Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'YYKit' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for YYKit

end

Carthage

安装Carthage

  brew install carthage

Carthage使用

配置文件 cartfile

Available commands:

   archive           Archives built frameworks into a zip that Carthage can use
   bootstrap         Check out and build the project's dependencies
   build             Build the project's dependencies
   checkout          Check out the project's dependencies
   copy-frameworks   In a Run Script build phase, copies each framework specified by a SCRIPT_INPUT_FILE and/or SCRIPT_INPUT_FILE_LIST environment variables into the built app bundle
   fetch             Clones or fetches a Git repository ahead of time
   help              Display general or command-specific help
   outdated          Check for compatible updates to the project's dependencies
   update            Update and rebuild the project's dependencies
   validate          Validate that the versions in Cartfile.resolved are compatible with the Cartfile requirements
   version           Display the current version of Carthage
touch cartfile

其他

Fink,pkgin,pkgsrc,Perlbrew,Nix,Conda,Rudi 和 Rudix等等。