调试前已经生成了规则的xcode文件。
现在dylib,需要主程序来引导启动,配置如下:
备注:启动引导工程需要用/Users/ganvinalix/oclint/build/oclint-release/bin/oclintExe ,oclintExe为oclint的拷贝,并设置oclintExe的文件属性为可执行。
接下来还需要配置入口调试参数(oclint可执行文件的输入参数)
配置的地方如下图:
命令如下:
-R=/Users/chen.peng/Documents/oclint/oclint-xcoderules/rules.dl/Debug /Users/chen.peng/Desktop/test/frame1codereview/Frame1/MainViewController.m -- -x objective-c
使用Debug文件夹下的规则文件检测MainViewController.m文件。
自己的工程往往文件是依赖的,所以需要把依赖信息一起作为参数传递进来,所以完整的代码如下:
-R=/Users/chen.peng/Documents/oclint/oclint-xcoderules/rules.dl/Debug /Users/chen.peng/Desktop/test/frame1codereview/Frame1/MainViewController.m -- -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fobjc-weak -fmodules -gmodules -fmodules-cache-path=/Users/chen.peng/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/chen.peng/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=Frame1 -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=12.1 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode-marker -index-store-path /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Index/DataStore -iquote /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Frame1-generated-files.hmap -I/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Frame1-own-target-headers.hmap -I/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Frame1-all-non-framework-target-headers.hmap -ivfsoverlay /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/all-product-headers.yaml -iquote /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Frame1-project-headers.hmap -I/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Products/Debug-iphoneos/include -I/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/DerivedSources/arm64 -I/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/DerivedSources -F/Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Products/Debug-iphoneos -MMD -MT dependencies -MF /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Objects-normal/arm64/BottomSwitchView.d --serialize-diagnostics /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Objects-normal/arm64/BottomSwitchView.dia -c /Users/chen.peng/Desktop/test/frame1codereview/Frame1/BottomSwitchView.m -o /Users/chen.peng/Library/Developer/Xcode/DerivedData/Frame1-bgntralxzmkspxgtyiarsrgxrlsv/Build/Intermediates.noindex/Frame1.build/Debug-iphoneos/Frame1.build/Objects-normal/arm64/BottomSwitchView.o
上面的信息其实就是我们用xcode build的build log信息。
然后build就可以调试了。
网友评论