Skip to content

iOS unit test: can't write file to iOS documents directory #27050

Answered by simonmcl
simonmcl asked this question in Actions
Discussion options

You must be logged in to vote

Seems the issue was the documents directory is not created by default when using GHA, and the error from xcode is super misleading.

I changed my code to use:

try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)

Instead and it works across the board. As for the logs, yes there are github actions available to upload logs as artifacts, this needs to be done for anything you want to save. There is a great github action that makes all of this much easier. Will auto upload logs during a failure and can be turned on to always upload if you want to see coverage for tests:

- uses: mxcl/xcodebuild@v1.5.1

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant