IOS uses Cocoapods to manage public components of a private library

Source: Internet
Author: User

The recent use of private public components, therefore, has the following story.

Reference Address: http://www.cocoachina.com/ios/20150228/11206.html

This article uses https://coding.net as the GIT private library address. The steps are as follows:

1. Create a private git repository. (Example: Skpodsstart, post-creation address: Https://git.coding.net/LeouCC/SKPodsStart.git

2. Add a private spec repo to the local, Terminal command as follows: Pod repo add [specreponame] [gitaddress]. For example

Pod Repo add Skpodsstart https://git.coding.net/LeouCC/SKPodsStart.git

After successful execution, go to: ~/.cocoapods/repos to view the local spec Repo you created.

Of course I made a mistake:

$ pod repo Add Skpodsstart https://git.coding.net/LeouCC/SKPodsStart.git

Cloning spec repo ' skpodsstart ' from ' https://git.coding.net/LeouCC/SKPodsStart.git ' [!]/usr/bin/git Clone https:// Git.coding.net/leoucc/skpodsstart.git Skpodsstartcloning into ' skpodsstart ' ...remote:Coding.net Tips: [You There are no permission to access this repo.] Fatal:unable to access ' https://git.coding.net/LeouCC/SKPodsStart.git/': The requested URL returned error:403

Description I do not have remote repository permissions, need to configure SSH KEY, I configure here. (Multiple coding account configuration SSH KEY, you can specify to a file, the command is as follows

Ssh-keygen-t rsa-f ~/.ssh/id_rsa.coding7834-c "[email protected]" The file I specified here is coding7834. View command: ~/.SSH

Then go to coding.net configuration, complete. Re-add a private spec repo to local.

3. Create a new project engineering file.

Command: Pod lib create private library. podspec file name   

For example: Pod lib create Posd

(This step skips if there are project projects already in process.) Here are a few questions, just answer truthfully. But the answer to the question is to execute the pod install command, which may require FQ.

Try adding/Modifying a file. After you add the modified file, you want to perform

Pod Update

4. Submit and push to the Git repository. The private library we created has files that need to be updated.

First add an Origin remote:git remote add Origin https://git.coding.net/LeouCC/SKPodsStart.git then update the project: Git pull origin Master add: Git Add. Commit: Git commit-m "Add all" push to Remote repository: git push-u Origin master Add a version tag:git tag 1.0.0 push Tag:git Push--tags   

5. Modify the. podspec file and verify the validity with pod Lib lint. (Execution results appear podtestlibrary passed validation. Otherwise, follow the error prompts to modify.) )。

6. Submit to the private library.

Command: Pod repo push specreponame. podspec file name.

7. Use a private library in other projects. This is different from the public library, we are private libraries, to specify the specific address.

SOURCE ' https://git.coding.net/LeouCC/SKPodsStart.git '  source ' https://github.com/CocoaPods/Specs.git '    Platform:ios, "7.0"   target "DF" do  pod ' Posd ', ' ~>1.0.0 'pod ' afnetworking 'end 

The process may encounter some problems, but these problems are not the problem, the solution is good.

Well, congratulations, you've done it.

IOS uses Cocoapods to manage public components of a private library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.