ObjC NSLog not printing in Xcode console when UITesting iOS11
Asked Answered
O

0

6

So have UITesting target that launches an app written in mixed ObjC and Swift code.

When running the app target normally, Swift's print() and ObjC's NSLog() statements print to the Xcode console fine on all devices and simulators.

But when running the app through the UITest the ObjC logs don't print in iOS 11, only the swift print() is logging.

Both print fine in iOS 10 and 9 in all cases.

Any ideas?

Onomatopoeia answered 27/10, 2017 at 5:6 Comment(6)
Just curious... What happens if you use C's printf() from your Objective-C code?Ens
@NicolasMiari Just checked, it printsOnomatopoeia
Your don't happen to have one of those #define NSLog(x) some-noop for release builds, do you?Ens
@NicolasMiari I do, but it's only for release builds, and I've tried disabling it to no avail.Onomatopoeia
I’m not sure if UI testing runs on release configuration either, but can’t think of anything else...Ens
@NicolasMiari You can choose in settings, and it's set to debug - I checked removing the #define NSLog... just as a sanity check.. Tred this on another computer by the way, same story! Will try with a new project on Monday.Onomatopoeia

© 2022 - 2024 — McMap. All rights reserved.