I have a large iOS project, and my problem is that, when running XCTests:
NSLog
s/print
s from within the app are not visible within the test log, but logs from within the tests are visibleI have another iOS project within the same workspace, and breakpoints and logging work fine.
The iOS project in question was originally created on an old version of Xcode (circa 2012, unsure which version exactly); and I have seen this comment elsewhere from somebody having seen this issue with an old .xcodeproj
.
The project itself is hybrid Obj-C/Swift, uses several Cocoapods, a watchkit extension, and tests divided into three targets.
Given my project's complicated configuration, I would prefer to avoid beginning again with a fresh .xcodeproj
and try to mirror exactly the configuration of my faulty one.
What could the reason for this fault be and what might I change within my existing .xcodeproj
's configuration to fix it?
The culprit was DEPLOYMENT_POSTPROCESSING = YES
in the project file.
Select your scheme, go to Edit scheme... and tick the Debug executable option under the Test > Info pane.
The debugger will attach to both your tests and your target application, and breakpoints will be hit on both parts of your project.
Note that when a breakpoint is hit in your target application, your test is still running and may time out, killing both applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With