Search Unity

[Solved]Using CocoaPods with cloud build ?

Discussion in 'Unity Build Automation' started by thibouf, Sep 6, 2018.

  1. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    Hello,
    I am not very familiar with cocoa pod, but need it to integrate a 3rd party sdk ... I have seen that cloud build now support cocoa pods. But I could not find any documentation on how to use it ..

    Can we simply put a Podfile somewhere ? Or is there anything that must be done in postprocess script ?
    Could somebody give me some sample of projects using it ?
     
  2. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
  3. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    CocoaPods is now installed on the Cloud Build build agents, we simply run "pod install" to install the dependencies before building the IPA file in Xcode.

    I have found this great example for using PostProcessBuild and the Xcode Manipulation API to include CocoaPod dependence in the Xcode Project, this could be used in conjunction with Cloud Build.

    I hope that helps!
     
    forteller likes this.
  4. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    Thank you for the answer. So if I understood I have to copy the pod file in the project forlder in the PostProcessBuild script.

    I don't know why, I was thinking that you had added something to automatically detect them and move them without the need for us to write a script
     
  5. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    460
    That is correct, the only thing that is automated on Cloud Build in regards to CocoaPods is the "pod install" step.
     
  6. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    105
    Thank you very much . I have successfully built what I needed .

    For eventual future reader, the Podfile sample in the given link is outdated. To work with current CocoaPods version you need to define the target. Here is an exemple of a current working Podfile :


    source 'https://github.com/CocoaPods/Specs.git'

    target 'Unity-iPhone' do
    pod "WhatYouNeed"
    end


    And also you won need to copy files open_pods.command and pods.command as "pod install" is called automatically in the cloud build process.
     
  7. evomo

    evomo

    Joined:
    Mar 31, 2020
    Posts:
    2
    Know anybody on which build step the pod install will be executed?

    On PostProcessBuild I copy the podfile into the xcode project folder. But I get an error that the pods do not exists.

    Any suggestions? Do I have to trigger the pod install?
     
    Last edited: May 28, 2020
  8. glaksmono

    glaksmono

    Joined:
    Nov 19, 2020
    Posts:
    21
    Hi, do you mind to post a step by step guide to resolve this?

    I'm still struggling on the same issue :(
     
  9. neapolitanstudios

    neapolitanstudios

    Joined:
    Feb 17, 2011
    Posts:
    75
    I'm bumping this too. This thread is the only resource I can find on this subject, and the article linked by @ollieblanks is fairly dated now and I'm struggling to get it working even following @thibouf 's advice.

    I think I'm having a similar problem to @evomo but I've also had issues relating to the "optional" 64-bit support - which I'm not sure is optional in 2021.

    Has anybody here got any advice for this? I'd love to figure this out and put some additional notes in here for future readers.
     
    Last edited: Sep 30, 2021