There seems to be no way to export logs from xcode, but as a workaround. If you use build / test with xcodebuild, you can get the NSLog output in the test results for UI tests from the command line tool,
xcodebuild -workspace my.xcworkspace -scheme myscheme -configuration Debug -sdk iphonesimulator9.0 -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.0' test
You can pass the iOS device as a destination specifier instead of a simulator.
I also looked at xcode logging for user interface tests, Xcode generates formatted test results with some predefined keys like {UDID}_TestSummaries.plist in the Logs/Test directory of the DerivedData application. However, it will not show you NSLog data but every test result log that appears in the Report Navigator, stored here as a key-shaft. You can convert this .plist to a dictionary and load it into your code to export it in any format. Hope this helps.
This test-logs blog is for everyone.
source share