title: XCTest: running tests fails with Cycle inside X; building could produce unreliable results in project with CocoaPods and Carthage
body: <p>After upgrading my project to Xcode 12, the test suite stopped working. The tests target doesn't compile, fails with:</p>
  <pre><code>Cycle inside &lt;redacted&gt;Tests; building could produce unreliable results. This usually can be resolved by moving the shell script phase '[CP] Embed Pods Frameworks' so that it runs before the build phase that depends on its outputs.
  Cycle details:
  → Target '&lt;redacted&gt;Tests' has copy command from '/Applications/Xcode12.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework' to '&lt;redacted&gt;/Library/Developer/Xcode/DerivedData/&lt;redacted&gt;-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/&lt;redacted&gt;.app/Frameworks/XCTAutomationSupport.framework'
  ○ Target '&lt;redacted&gt;Tests': CodeSign &lt;redacted&gt;/Library/Developer/Xcode/DerivedData/&lt;redacted&gt;-bxjgdjscysiavpfrzmquaqdkncsl/Build/Products/Debug-iphonesimulator/&lt;redacted&gt;.app/PlugIns/&lt;redacted&gt;Tests.xctest/Frameworks/CryptoSwift.framework
  ○ That command depends on command in Target '&lt;redacted&gt;Tests': script phase “[CP] Embed Pods Frameworks”
  </code></pre>
  <p>The script is the last build phase in the target so I'm a bit lost. Any clue? Thank you.</p>