Can I debug iOS app installed from IPA archive?

前端 未结 3 1204
醉梦人生
醉梦人生 2020-12-24 15:08

I m having some problem with my app which reproduces only when i install it ad hoc, but doesn\'t reproduce if i just run the app from Xcode. I would like to debug this prob

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 15:40

    I was struggling with the same problem, and just launching my app from Xcode was not an option - I had to build the IPA, sideload it on an iOS device, and then debug. Eventually I was able to make that work with the following steps:

    1) Set the scheme archive target to Debug

    2) Change the following settings for the Debug builds

    • Keep Private External Symbols (KEEP_PRIVATE_EXTERNS) : YES
    • Enable Bitcode (ENABLE_BITCODE) : NO
    • Strip Linked Product (STRIP_INSTALLED_PRODUCT) : NO

    3) Rebuild, archive, and deploy the resulting IPA file to your iOS device.

    4) Launch the app, and in Xcode, select Debug/Attach to Process/YourAppName(id)

    5) Break into the debugger - you should be able to see the code, put and use breakpoints, etc.

    If you want to debug your code from the very beginning, just put a loop that sleeps for a second or two and then checks a flag at the top of your main function - when you break into the debugger, just change the flag to let it escape the loop.

提交回复
热议问题