LoginSignup
0
1

More than 3 years have passed since last update.

Danger用にxcpretty-json-formatterを実行して ld: symbol(s) not found for architecture x86_64 になった時には-fprofile-arcsを追加する

Last updated at Posted at 2020-07-08

環境

  • Xcode11.3.1, CocoaPods1.5.3, FirebaseCore6.6.6

現象

BitriseのWorkflow内でDangerを回している際に
xcpretty-json-formatterの出力を指定した以下のスクリプトでテストビルドを実行
すると「 ld: symbol(s) not found for architecture x86_64 」のエラーが発生した。

set -o pipefail && env "NSUnbufferedIO=YES" xcodebuild -workspace $WORKSPACE -scheme $SCHEME \ 
clean build test -destination "platform=iOS Simulator,name=iPhone Xs,OS=12.4" \
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | \ 
XCPRETTY_JSON_FILE_OUTPUT=xcodebuild.json xcpretty -f `xcpretty-json-formatter`

スクリーンショット 2020-07-08 11.00.40.png

対応内容

Build Settings > Other Linker Flags-fprofile-arcsを追加

スクリプトは以下に変更

set -o pipefail && env "NSUnbufferedIO=YES" xcodebuild -workspace $WORKSPACE -scheme $SCHEME \ 
clean build test -destination "platform=iOS Simulator,name=iPhone Xs,OS=12.4" \ 
"GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES" "GCC_GENERATE_TEST_COVERAGE_FILES=YES" \
"OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -fprofile-arcs" | \ 
XCPRETTY_JSON_FILE_OUTPUT=xcodebuild.json xcpretty -f `xcpretty-json-formatter`

参考リンク

助けて頂きました。ありがとうございます🙏

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1