How To Check If Not Running In Debufgger Swift

[Solved] How To Check If Not Running In Debufgger Swift | Swift - Code Explorer | yomemimo.com
Question : how to check if not running in debufgger swift

Answered by : quaint-quail-rblyi6q3wthz

func amIBeingDebugged() -> Bool { var info = kinfo_proc() var mib : [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] var size = strideofValue(info) let junk = sysctl(&mib, UInt32(mib.count), &info, &size, nil, 0) assert(junk == 0, "sysctl failed") return (info.kp_proc.p_flag & P_TRACED) != 0
}

Source : https://stackoverflow.com/questions/33177182/detect-if-swift-app-is-being-run-from-xcode | Last Update : Fri, 23 Oct 20

Answers related to how to check if not running in debufgger swift

Code Explorer Popular Question For Swift