0

我正在尝试生成一些文档。我的项目使用 Jazzy。但是,当我从命令行运行时jazzy,我得到以下输出:

Could not successfully run `xcodebuild`.
Please check the build arguments.
Saved `xcodebuild` log file: /var/folders/nd/t1rlxsp94kgbll0v834jnc0h0000gp/T/xcodebuild-84D58051-E84E-40D8-A4E7-E080B83D7117.log
Failed to generate documentation
Traceback (most recent call last):
    7: from /usr/local/bin/jazzy:23:in `<main>'
    6: from /usr/local/bin/jazzy:23:in `load'
    5: from /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/bin/jazzy:15:in `<top (required)>'
    4: from /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/lib/jazzy/doc_builder.rb:79:in `build'
    3: from /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/lib/jazzy/doc_builder.rb:79:in `chdir'
    2: from /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/lib/jazzy/doc_builder.rb:81:in `block in build'
    1: from /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/lib/jazzy/sourcekitten.rb:266:in `run_sourcekitten'
/usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/lib/jazzy/executable.rb:36:in `execute_command': /usr/local/lib/ruby/gems/2.7.0/gems/jazzy-0.13.6/bin/sourcekitten ["doc", "--"] (RuntimeError)

Running xcodebuild

Could not successfully run `xcodebuild`.

Please check the build arguments.

Saved `xcodebuild` log file: /var/folders/nd/t1rlxsp94kgbll0v834jnc0h0000gp/T/xcodebuild-84D58051-E84E-40D8-A4E7-E080B83D7117.log

Failed to generate documentation

为什么从 xcode 我的项目构建没有问题时运行失败

4

4 回答 4

3

Jazzy 需要从命令行构建来生成文档。所以你需要一个类似的命令:

jazzy --build-tool-arguments -workspace,ios.xcworkspace,-scheme,iosapp

来自https://github.com/realm/jazzy

...尝试将额外的参数传递给 xcodebuild,例如jazzy --build-tool-arguments -scheme,MyScheme,-target,MyTarget


如何xcodebuild从 Jazzy中找到要传递的计划和目标

确保到cd您的 Xcode 工作区或 Xcode 项目所在的目录: cd path/to/ios.xcworkspace

xcodebuild -version

# online help
man xcodebuild

# List schemes & targets
xcodebuild -list

示例 Xcode 工作区的结果,

Information about project "ios":
    Targets:
        iosapp
        bench
        dynamic
        static
        bundle
        test
        integration
        Integration Test Harness

    Build Configurations:
        Debug
        Release
        RelWithDebInfo

    If no build configuration is specified and -scheme is not passed then "RelWithDebInfo" is used.

    Schemes:
        bench
        bundle
        CI
        dynamic
        dynamic+static
        Integration Test Harness
        iosapp
        static
于 2021-01-22T18:53:28.713 回答
0

通常,第一次运行 Jazzy 时会出现以下两种情况之一。要么您没有设置xcodebuild使用完整的 Xcode 应用程序而不是纯命令行工具,要么您忘记在参数中指定工作区或方案。在使用 Cocoapods 或您有多个方案时尤其如此。

至少使用这些参数,Jazzy 应该在大多数情况下运行:

cd yourAppDirectory # the one with the xcodeproj / xcworkspace in it
jazzy --clean --author "Johnny Appleseed" --author_url https://siriuscybernetics.com -x -workspace,DemoApp.xcworkspace,-scheme,DemoAppScheme

还要考虑到与 Apple Silicon / M1 可能有一段时间不兼容,例如这个Bus Error主题。

于 2022-01-05T09:41:59.047 回答
0

它对我有用!删除所有项目源代码文件并再次克隆 repo 后!:)

于 2022-02-14T18:28:25.097 回答
0

您可以查看内容

log file: /var/folders/nd/t1rlxsp94kgbll0v834jnc0h0000gp/T/xcodebuild-84D58051-E84E-40D8-A4E7-E080B83D7117.log

获取详细信息错误

于 2021-12-17T15:18:27.050 回答