I am currently using xcode built-in tasks and facing issue while caching and reducing its time. I have already used caching in the same pipeline to reduce Cocoa Pods time too.
After successful caching of cocoa pods, /ios/ now includes Pods dir too but Xcode build still takes almost 30 mins
We can reduce build time using caching. You need to find code that compiles slowly during the build process. Check if there are other parts which can be cached in the pipeline.
Basically, if it has the same behavior when building on your local developer machine, then I don't think there's a good way to reduce the build time in pipeline.
Reference the following threads to check that: