How to disable automatic screenshots when testing the user interface (Xcode)

I am running Xcode UI Testing through Jenkins. Screenshots are taken at every step, so after starting the package for a while, the Mac uses all the space on the hard drive. Does anyone know if you can turn off the automatic screenshots of Xcode UI Testing, so less space is used?

+8
iphone xcode xcode-ui-testing screenshot
source share
3 answers

I did not find a reliable way to deactivate screenshots, but the size taken by them was deleted by setting the following in jenkins:

Jenkins> Open Job> Configure> Build> Xcode> Advanced Build Settings> check the box "Clean test reports"

Now this leads to the fact that the test results have a much more manageable size, and I can constantly keep my test packages in jenkins.

Hope this helps someone else.

+1
source share

I'm not sure how to turn off the screenshots, but you can put the screenshots in the place where they will be deleted:

xcodebuild -workspace App.xcworkspace \ -scheme "SchemeName" \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.0' -derivedDataPath '/dev/null' test 

Note the -derivedDataPath '/dev/null' , which will take screenshots. This will place the screenshots on the null device, which is a special device that discards the information recorded on it.

Hope this helps, happy testing!

+3
source share

Another way to do this is to configure Xcode Scheme to not take screenshots by doing the following in Xcode:

  • Change the scheme (Cmd + Shift + <)
  • Click Test Configuration on the left.
  • Click "Options" at the top
  • Uncheck "Capture screenshots automatically." Alternatively, you can save this, but also check β€œDelete when each test succeeds” if you just want screenshots for crashes.

Xcode Edit Scheme

0
source share

All Articles