gpt4 book ai didi

ios - 如何打开 .swiftmodule 文件

转载 作者:搜寻专家 更新时间:2023-11-01 06:55:53 25 4
gpt4 key购买 nike

我想检查来自 iOS 框架的 .swiftmodule 文件的公共(public)内容。

在这里 ( https://lists.swift.org/pipermail/swift-users/Week-of-Mon-20160111/000827.html ) 我发现了使用 swift-ide-test 的建议:

You can use the swift-ide-test tool to dump the public interface for a module, but the command-line interface is less pretty than it should be:

swift-ide-test -print-module -source-filename=dummy.swift -module-to-print=MyApp

…plus any -I or -F paths necessary to find your module and all its dependencies. If you're on a Mac, you'll need to insert "xcrun -sdk macosx" or "xcrun -sdk iphoneos" at the start to find the system headers.

不幸的是,当我尝试使用 Xcode 10.1 运行 xcrun -sdk iphoneos swift-ide-test 时,出现以下错误:

$ xcrun -sdk iphoneos swift-ide-test
xcrun: error: unable to find utility "swift-ide-test", not a developer tool or in PATH

似乎此工具已从 Xcode 中删除。

关于如何打开 .swiftmodule 文件还有其他想法吗?

最佳答案

经过几个小时的努力,我找到了一种从 iOS 框架检查模块公共(public)内容的隐式方法。

这个技巧是通过在 Swift REPL 中使用 :print_module 命令来完成的。

更准确地说,您需要使用框架路径启动 Swift REPL:

swift -F <path to a folder with LibName.framework> -deprecated-integrated-repl

现在您可以使用带有框架名称的:print_module 命令:

(swift) :print_module LibName

来源:

https://stackoverflow.com/a/27882120/2241008

https://stackoverflow.com/a/25005445/2241008

https://stackoverflow.com/a/36235186/2241008

附言swift 源仍然有 swift-ide-test 工具(https://github.com/apple/swift/tree/master/tools/swift-ide-test)的源代码,所以另一种查看 swiftmodules 内容的方法是编译这个工具,但我没有调查这个解决方案进一步。

关于ios - 如何打开 .swiftmodule 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53416742/

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