Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[Solved]Using CocoaPods with cloud build ?

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

  1. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    33
    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:
    33
  3. ollieblanks

    ollieblanks

    Unity Technologies

    Joined:
    Aug 21, 2017
    Posts:
    65
    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!
     
  4. thibouf

    thibouf

    Joined:
    Mar 17, 2017
    Posts:
    33
    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:
    65
    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:
    33
    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.
     
    ollieblanks likes this.