How to use local-only project via CocoaPods

Local CocoaPods

[Dependency manager]

[Cocoapods with specyfic branch]

Example with Git:
enter image description here

Textual

Podfile

//Podfile pod supports:
//default(try to find .podcpec in centralised repo), path
//-remote    
    pod 'PodName'
//-local     
    //local_path can be absolute or relative
    pod 'PodName', :path => '<local_path>.podspec'

Podspec

//Podspec source supports:
//git, svn, hg, http
//-remote    
    s.source = { :git => "https://url_to.git", :tag => "git_tag" }
//-local     
    s.source = { :git => 'file:///path_to_git_folder', :tag => "git_tag" }
    //or, where path_to_git_folder can be relative
    s.source = { :git => '/path_to_git_folder', :tag => "git_tag" }

Do not forget to commit your changes beforehand. git_tag can be the same as a branch name.

Several useful commands:

Update:

Podfile:

pod update

Check
.podspec:

pod spec lint "<some_path>.podspec" --quick
pod spec lint "<some_path>.podspec" --verbose --allow-warnings

Register session:

pod trunk register <email> '<name>' --description='<description>' 

Release:

pod trunk push <file>.podspec --verbose --allow-warnings

Pod search[About]:

pod search <pod_name>

[Local Carthage]
[Local Swift Package Manager]

[Android Maven local]

Leave a Comment