我正在尝试为生成一些文档。我的项目使用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中我的项目构建没有任何问题时,它无法运行
发布于 2021-01-23 02:53:29
Jazzy需要从命令行构建来生成文档。因此,您需要一个类似以下内容的命令:
jazzy --build-tool-arguments -workspace,ios.xcworkspace,-scheme,iosapp来自https://github.com/realm/jazzy
向xcodebuild传递额外参数的
...try,例如
jazzy --build-tool-arguments -scheme,MyScheme,-target,MyTarget
如何找到要从Jazzy传递到xcodebuild的方案和目标
xcodebuild -version
# online help
man xcodebuild
# List schemes & targets
xcodebuild -list示例Xcode Workspace的结果,
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-12-17 15:18:27
您可以查看
log file: /var/folders/nd/t1rlxsp94kgbll0v834jnc0h0000gp/T/xcodebuild-84D58051-E84E-40D8-A4E7-E080B83D7117.log以获取错误的详细信息
发布于 2022-01-05 09:41:59
通常,在第一次运行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主题。
https://stackoverflow.com/questions/65634426
复制相似问题