Xcode 8 Breakpoint in file not working

前端 未结 11 667
Happy的楠姐
Happy的楠姐 2020-12-31 00:42

I have one file,SignInViewController.swift, in my Xcode project that out of nowhere has begun not stopping on breakpoints. I have a breakpoint in viewDidL

相关标签:
11条回答
  • 2020-12-31 01:17

    Sometimes the values may have changed in Xcode userdefaults itself, At times, I had similar issue with debugger stopping at stacktrace Few ways to clear this

    1.Delete the Xcode preference
    defaults delete com.apple.dt.Xcode
    

    Other Issue could be the optimization level for the target, changing it to none will stop at the debugger

    0 讨论(0)
  • 2020-12-31 01:18

    Open viewController.swift file for initial view in the standard editor and print something inside viewDidLoad and run application.. if the print is working properly, now make sure you have selected viewController.swift file correctly in the assistant editor.

    0 讨论(0)
  • 2020-12-31 01:20

    In my case breakpoint was not hit in just one callback, so I changed "Swift Compiler" "Optimization Level" to "No optimization" in project target build settings for debug, and it started working in Xcode 9.3 as well as AppCode.

    0 讨论(0)
  • I was also dealing with the same issue in xcode 9.

    I resolved the issue in below ways:

    • Remove XCode defaults Using below terminal command

      defaults delete com.apple.dt.Xcode.LSSharedFileList   
      defaults delete com.apple.dt.Xcode
      
    • Clear(or delete) Xcode's DerivedData from

      /Users/[Your Mac Username]/Library/Developer/Xcode/DerivedData
      
    • Delete(or uninstall) Xcode.app from Applications and then restart PC

    • Install fresh copy of Xcode 9

    • [Mandatory] Set user permission to your app project like

      chmod -R 777 "/Users/[Your Mac Username]/Desktop/TestApp/"
      

      [where TestApp is the app project keeping on Desktop]

    • Open the project and check Build Settings are set to Debug

    • Make sure breakpoints are enabled and set debug point in your code
    0 讨论(0)
  • 2020-12-31 01:22

    What helped for me was deleting the file Breakpoints_v2.xcbkptlist which is located under the project directory (*.xcodeproj) in the directory: xcuserdata/Fred.xcuserdatad/xcdebugger (replace "Fred" with your username). Use a terminal program to go there.

    0 讨论(0)
  • 2020-12-31 01:23

    I solved this by going to my Xcode project's 'Build Settings' and setting 'Generate Debug Symbols' to 'Yes'

    0 讨论(0)
提交回复
热议问题