gpt4 book ai didi

ios - 如何使用 Xcode 11.4 导出/获取 xxx.framework?

转载 作者:行者123 更新时间:2023-12-01 21:56:20 30 4
gpt4 key购买 nike

在 Xcode 11.4 之前我构建了项目,我也可以在 xxx/Build/Products/Debug-iphoneos 的路径中找到 xxx.framework。

使用 Xcode 11.4 后,我在该路径中找不到任何 xxx.framework。

我看过链接,How to archive/export Framework in Xcode?我按照步骤获取框架,但 Xcode 11.4 没有。

有人知道如何使用 Xcode 11.4 获取框架吗?

最佳答案

这里有两种方法。
方法一 (你说的方法不适合你,但最流行):

  • 清理你的框架(不是必需的,但很好的做法)

    Shift + Command + K or Product > Clean Build Folder (Some ask: where is this Product. Just hover your mouse at the top of the screen whilst in Xcode, you'll see it there.)


  • 构建你的框架

    Command + B or Product > Build


  • 导出/提取/复制您的框架

    On the left panel of Xcode (Where you see all your folders and swift files), expand the folder that's named Products (tap on the little white arrow next to the folder Products to expand it and see its contents.)


    Once you expanded the Products folder, you should see a very good looking framework staring right at you. The name should look something like this YourProjectName.framework


    Now to finally answer your question - HOW TO EXPORT THE FRAMEWORK...well right click on the framework (the YourProjectName.framework) and click on Show in Finder.


    Once you clicked on Show in Finder, you'll see your YourProjectName.framework folder. Yes yes, it looks like a normal folder. That's because it is. Everyone just makes it sound fancy.


    And there you go. You can then just drag that fancy-ish YourProjectName.framework folder into you project.



  • 方法二 (这里我假设你已经阅读了方法 1,所以我会用更少的细节来解释):
  • 清理你的框架(不是必需的,但很好的做法)
  • 归档你的框架

    Product > Archive (Don't be surprised if you wait a couple of seconds for it to archive.)


    Once it's done archiving. You'll see it opens a new Xcode like window. If you don't see this window, it means you were busy with other stuff on your mac at the time it finished. Don't worry haha, just look around on your mac until you find it. If you still don't find it, chances are the archiving failed. If it failed, Xcode will give you an error log. Read it, fix it, try archiving again.


    Once it finished archiving and you see the Xcode-like window. Your archive will be highlighted. It just shows its selected.


  • 导出/提取/复制您的框架

    Right click on the archive and say Show in Finder


    The finder will open and have your archive selected.


    Right click on that archive and select Show Package Contents


    The finder will open your archives contents.


    Navigate to your framework which is located under Products > Library > Frameworks


    There you'll find your YourProjectName.framework folder. select that folder and drag it into your project.



  • 如果上述方法都不适合您,我想它为您提供了寻找另一种方法的机会。当您这样做时,请返回此答案并添加您的方法,以便我们所有人都可以学习。

    关于ios - 如何使用 Xcode 11.4 导出/获取 xxx.framework?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61172182/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com