I am running Xcode's UI Testing through Jenkins. Screenshots are taken at each step and so after running the suite for a while, the Mac uses up all its hard drive space. Does anyone know if you can switch off Xcode UI Testing's automatic screenshots, so less space is used?
I didnt find a reliable way to deactivate screenshots, but the size taken up by them was removed by setting the following in jenkins:
Jenkins > Open Job > Configure > Build > Xcode > Advanced build settings > tick the box labelled 'Clean test reports'
This now keeps the test results in a far more manageable size and means I can constantly keep my test suites running in jenkins.
Hope this helps someone else.
Another way of doing this is configuring your Xcode Scheme to not take screenshots, by doing the following in Xcode:
- Edit Scheme (Cmd+Shift+<)
- Click on Test configuration on left side
- Click Options on top
- Uncheck "Capture screenshots automatically". Alternatively you can keep this checked but also check "Delete when each test succeeds" if you just want screenshots for failures.
-resultBundlePath
xcbuild param? So ideally successful test screenshots should be deleted while unsuccessful kept. –
Adipose xcodebuild
, but I've actually found that this seems to be the default. (Was sure it wasn't the case as had them for 1 successful test on server somehow and figured that's the norm) I've also found you can specify SystemAttachmentLifetime
and UserAttachmentLifetime
through the .xctestrun
files so putting here in case anyone needs –
Adipose I'm not sure how to turn off screen shots but you could put the screen shots to a location where they'd 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 is where the screen shots will be going. This will put the screen shots to the null device, which is a special device which discards the information written to it.
Hope that helps, happy testing!
I didnt find a reliable way to deactivate screenshots, but the size taken up by them was removed by setting the following in jenkins:
Jenkins > Open Job > Configure > Build > Xcode > Advanced build settings > tick the box labelled 'Clean test reports'
This now keeps the test results in a far more manageable size and means I can constantly keep my test suites running in jenkins.
Hope this helps someone else.
© 2022 - 2024 — McMap. All rights reserved.