When running UI tests on my iOS app on our Jenkins CI slave, the UI is incorrect and my tests fail. Locally, the same UI is as expected and the tests pass.
I haven't been able to figure this out and I cannot debug it as it is on a remote machine. So, I would like to add logging to see what decisions are being made by the app to figure out why the UI is displaying incorrectly in the remote Jenkins slave.
The test log output does not contain log output from the app (via NSLog
), nor can I find any of the strings from the appNSLog
calls in any .xcactivitylog file in the derived data output folders.
Where can I find my logging output from my app when it is being run by the UI tests? This is with Xcode 8.2 running a iOS 9.3 simulated device.
The following solution is a bit hacky but allows you to get the logs even when running on the device.
Logger.h
Logger.m
Then from the UI Test, I can access the logs like this