已解决
1、先编译数据 database
xcodebuild -workspace xx.xcworkspace -scheme XX -sdk iphoneos14.5 | tee xcodebuild.log | xcpretty -r json-compilation-database -o compile_commands.json
2、再执行 infer 指令
infer run --keep-going --skip-analysis-in-path Pods --compilation-database-escaped compile_commands.json

=====================================
安装了 infer 工具后,
跑了官网 java 和 objectc 的 helloword 小示例 都可以运行,但是跑 ios 项目的时候就报错了

如下是报错信息

External Error: *** capture failed to execute: exited with code 64
Error backtrace:
Raised at Stdlib.input_line.scan in file "stdlib.ml", line 449, characters 14-31
Called from Stdio__In_channel.input_line_exn in file "src/in_channel.ml" (inlined), line 68, characters 13-30
Called from IBase__Utils.with_channel_in in file "src/base/Utils.ml", line 260, characters 11-44
Re-raised at IBase__Die.raise_error.do_raise in file "src/base/Die.ml", line 26, characters 8-56
Called from Integration__Driver.capture in file "src/integration/Driver.ml", line 145, characters 6-36
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 429, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml", line 79, characters 29-44
Called from Backend__GCStats.log_f in file "src/backend/GCStats.ml", line 90, characters 10-14
Called from Dune__exe__Infer.run in file "src/infer.ml", line 20, characters 2-36
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 429, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml", line 79, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94


↙↙↙阅读原文可查看相关链接,并与作者交流