Xcode 7 UITest Export Logs

I am using Xcode7-UItest to test my application.

I have added some logs to the files for my UITestTarget. These tests will run on the device through my Xcode machine. I can view these logs on Xcode in the "Show Report Navigator" section, but I want to send these logs from the build machine to other developers so that they can view these logs.

Is there a way to collect and export these UITest logs through Xcode? The only way I could find to do this was by manually copying the pasting logs from Xcode and this is a cumbersome process.

+5
source share
1 answer

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.

+3
source

Source: https://habr.com/ru/post/1232232/


All Articles