what's the purpose of "--no-use-binaries" in carthage

IosCarthage

Ios Problem Overview


As titled, what's the purpose of "--no-use-binaries" in carthage command line? if missing this, what could happen and what's the benefit to have this?

Ios Solutions


Solution 1 - Ios

Sometimes the prebuilt frameworks are corrupted in the dependencies’ project, so you need to build them locally.

Also, those prebuilt frameworks don’t support step-by-step debugging, so unless you build them locally, you won’t be able to use this feature with your dependencies.

Using --no-use-binaries compiles the projects locally, using your compiler.

Executing the update command might occasionally produce an error when the Swift language updates to a newer version while the dependency is built for an older version of Swift (even if it’s still compatible). You can solve such scenarios by using this flag.

One disadvantage is that it takes longer to compile the project with the --no-use-binaries flag. Without the flag, you’re requesting the prebuilt framework if it’s available. For more information you can see this Carthage issue on GitHub.

Hope I cleared up your doubts.

Solution 2 - Ios

Carthage --no-use-binaries

As a framework developer you have two ways or even you can use both of them:

  1. Share closed source code(Pre-built framework). For example you can use carthage archiveOfficial and add it to Github release attachments. Carthage build is faster but framework cannot be debugged on some other computer or you can get next compile error
    Incompatible Swift version - framework was built with <version_1> and the local version is <version_2>
    
  2. Share open source code. For example you publish your code on Github.com.

As a framework consumer you have next Cartfile

github "SomeCompany/SomeFramework"

By default Carhage first of all try to use closed source code. But when you specify --no-use-binaries Carthage first of all try to use open source code and if dont't find it closed source code will be used

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLiangWangView Question on Stackoverflow
Solution 1 - IosCristian Erik Ames MasekView Answer on Stackoverflow
Solution 2 - IosyoAlex5View Answer on Stackoverflow