A Tool to Detect Swift Potential Leaks
brew install mint
mint install yume190/LeakDetect
USAGE: command [--verbose] [--mode <mode>]
PROJECT_TEMP_ROOT
/PROJECT_PATH
TARGET_NAME
PROJECT_TEMP_ROOT
="/PATH_TO/DerivedData/TypeFill-abpidkqveyuylveyttvzvsspldln/Build/Intermediates.noindex"PROJECT_PATH
="/PATH_TO/xxx.xcodeproj" or "/PATH_TO/xxx.xcworkspace"TARGET_NAME
="Typefill"
PROJECT_PATH: relative path
PROJECT_TEMP_ROOT: absolute path
assign
capture
Detect assign instance function x = self.func
or y(self.func)
.
see Don't use this syntax!.
Detect instance captured by blocks(closure/function).
git clone https://github.com/antranapp/LeakDetector
cd LeakDetector
# Must build once or use XCode to build
xcodebuild -workspace LeakDetectorDemo.xcworkspace -scheme LeakDetectorDemo -sdk iphonesimulator IPHONEOS_DEPLOYMENT_TARGET=13.0 build
export PROJECT_PATH=LeakDetectorDemo.xcworkspace
export TARGET_NAME=LeakDetectorDemo
leakDetect --mode capture