- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我想检查来自 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/
在过去的几个月里,我已经将我的一个包含大约 1500 个源代码文件的项目转换为 Swift。这非常乏味,但我终于做到了。它运行良好,构建良好,但是: 当我尝试归档项目时,Xcode 失败并显示以下错误
我想检查来自 iOS 框架的 .swiftmodule 文件的公共(public)内容。 在这里 ( https://lists.swift.org/pipermail/swift-users/Wee
xcodebuild 失败并出现以下错误: :0: error: unable to execute command: Segmentation fault: 11 :0: error: merge-
我正在尝试使用 XCode v. 6.3 (6D520o) 编译 Swift 1.2 iOS 项目。它通过“编译 Swift 源文件” :0: error: unable to execute com
我正在将一个旧应用程序从 swift 3 迁移到 swift 4,但遇到了这个错误: error: Multiple commands produce '/Users/.../Library/Deve
我正在使用 Vapor 为 Ubuntu 编写我的 Swift 应用程序。我的任务是为生产提供最小的 Docker 镜像。我已经大幅缩减了图像,但出于好奇,我想知道我的最终可执行文件是否需要所有已编译
我想通过 Cocoapods podspecs 添加扩展名为 .swiftdoc 和 .swiftmodule 的文件。 这些文件应该添加到“swift 编译器搜索路径”下的“导入路径”中。 这怎么可
在 Xcode 6.3 中构建应用程序在 Merge MyApp.swiftmodule 的步骤上卡住了几分钟(大约 10 分钟): MergeSwiftModule normal x86_64 /U
我是一名优秀的程序员,十分优秀!