0

I'm working on Pod projects at work, the main goal is to isolate portions of the main app into separate libraries.

The thing is that the process of developing a pod, then testing it on the main app seems to be too slow. Much slower than developing the main project by itself for instance.

My main complain is that Xcode 10 requires me to do the following in order for the main project to get the changes:

  1. To rebuild the pod.
  2. Run pod update on my main project.
  3. Index and rebuild the main project

I was wondering if someone knows how to avoid step 2 (which also reduces the indexing of the main project from step 3).

Nativ
  • 3,092
  • 6
  • 38
  • 69

3 Answers3

1

I am having a similar issue with the project I am currently working on.

It appears this is a bug that was introduced in CocoaPods as of XCode 10. We may only hope for a fix in the future.

However, your steps are longer than mine. When modifying a file in our development pod we need to

  1. Run Product -> Clean build folder
  2. Run the app as you normally would

When creating a new file inside of our development pod we need to

  1. Run pod install
  2. Run the app as you normally would

The pod command-line operations seem to only be relevant when adding new files, or deleting old ones. Editing of a file can be detected using only a clean. Using this may cut off in your build times in the future.

Ferdz
  • 1,182
  • 1
  • 13
  • 31
  • If you're talking about Development pods, I had that exact issue for years, so it's not really something new with Xcode 10. – Cœur Mar 11 '19 at 13:48
1

I also experienced this problem a while ago. My solution is to switch to Legacy build system (File -> Project/Workspace Settings). Build it again, check if new changes in your frameworks updated. Then you can switch back to New Build System.

Hope this helps.

qtngo
  • 1,594
  • 1
  • 11
  • 13
0

The correct work methodology that has best worked for me is the following:

1) Build system: credit goes to @qtngo.

To change to the legacy build system. That way Xcode knows to build the changes as you go and doesn't require rebuilding everything.

how to do it: Go to File -> Workspace/Project Settings -> Build System - here change to legacy.

2) In PodFile set the pod referencing a local library:

 if development
    pod 'YourPod', :path => '../your_pod'
  else
    pod 'YourPod', :git => 'https://user@bitbucket.org/company/your_pod.git'
  end

Then, run pod install after deleting the cached pod data and develop on the created workspace.

3) Creating files You can create new files in your pod development folder right through the main project workspace. Just be aware that the files are going to be registered at in the pod project file and NOT in your pod project file. So simply open in parallel Xcode instance your pod project and add the files(or just do it before committing but it can get messy in case of many new files).

4) Checking everything:

4.1) Commit and push your pod.

4.2) Clear the pod data from the main project(Pods folder + Podfile.lock) and set the flag development to false. We need this step because the current workspace contains your pod as a development pod in a designated development folder. So hit pod install to get the remote pod with your recent changes. If everything compiles and run as expected feel free to commit+push the pod as part of the app.

Nativ
  • 3,092
  • 6
  • 38
  • 69