Use the pod trunk release program to make your project accessible by the pod search, podtrunk

Source: Internet
Author: User
Tags install cocoapods

Use the pod trunk release program to make your project accessible by the pod search, podtrunk
Use pod trunk to publish a program

The integration and use of CocoaPods has been mentioned before, and there are indeed a lot of conveniences for pods integration and management of the third-party framework. Here we will not talk about the advantages. There are a lot of advantages. Do you want to make your project impulsive to others' pods. You don't have to talk about the theme if you have.

1. Registration
  • $: Pod trunk register mailbox 'username' -- description = 'computer description'
2. check emails
  • Other mailboxes directly go to the click link
  • If it is a QQ mailbox, it may be placed in the "garbage bin", not necessarily "inbox"
  • Click the link in the email:
    Https://trunk.cocoapods.org/sessions/verify/xxxx
  • Click the email link to complete the trunk registration process.
3. After registration, you can view your personal information.
  • $:pod trunk me
The result is displayed as follows:
-Name: the username you just entered-Email: xxxxxx@example.com-Since: March 28th,-Pods: None-Sessions:-March 28th,-June 5th. IP: xxx. xxx. xxx. xxx Description: Macbook Pro
  • This error may occur in the middle.
NoMethodError - undefined method 'last' for #<Netrc::Entry:0x007fc59c246378>
  • Update the gem source or pod.
    • $:sudo gem update --system
    • $:sudo gem install cocoapods
    • $:sudo gem install cocospods-trunk
4. Create a podspec File
  • Add a podspec description file to your project code to describe your project information.
  • Push the podspec file to the CocoaPods server through trunk
  • Note: All the files described below should be saved under the root directory of the local git repository.

4.1 how to create a podspec File
There are two ways to create your own podspec file:
① Copy the parameter corresponding to the podspec file of the mature open-source library.
② Execute the following creation command:
* $:Pod spec cretae file name 
For example, the pod spec cretae DJStatusBarHUD will generate a DJStatusBarHUD. podspec

& We recommend that you directly change the podspec of some mature open-source libraries. The generated templates have many redundant attributes. Enter the podspec content
$:Pod::Spec.new do |s|  s.name         = "DJStatusBarHUD"  s.version      = "0.0.1"  s.summary      = "The easily and conveniently use of statusBar"  s.homepage     = "https://github.com/djliu328/DJStatusBarHUD"  s.license      = "MIT"  s.author       = { "dj_liu" => "xxxxx@example.com" }  s.source       = {:git => 'https://github.com/djliu328/DJStatusBarHUD.git', :tag => s.version}  s.source_files = 'DJStatusBarHUD/**/*.{h,m}'  s.resource     = 'DJStatusBarHUD/DJStatusBarHUD.bundle'  s.requires_arc = trueend
  • Note that the current podspec must have a tag, so it is best to create a tag and upload it to github.
    • $:git tag 0.0.1
    • $:git push --tags
& CocoaPods can find your repo more accurately only when the above two points are ensured. 5. Check the podspec syntax (verify that your podspec file is valid using the following command)
  • $:pod spec lint MJExtension.podspec
6. Publish podspec

Finally, you can upload your podspec file through trunk. First cd to the directory where the podspec file is located, and then:
* $:pod trunk push MJExtension.podspec 
* If it is the first release of the pod, go to https://trunk.cocoapods.org/claims/new pod (I don't think I can use it at the time, so I should choose it myself)

7. Detection

Sometimes, after the release is complete, the pod search finds nothing. This does not necessarily mean that your project has not been uploaded successfully, and there may be latency. You can try the following operations:
* $:pod setup: Initialization
* $:pod repo update: Update a repository
* $:pod search DJStatusBarHUD

8. repository update
  • If the repository is updated slowly, consider changing the repository image.
    • $:pod repo remove master
    • $:pod repo add master http://git.oschina.net/akuandev/Specs.git

Related Article

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.