The documentation states that
Warning
Always test Watch Connectivity file transfers on paired devices. The Simulator app doesn’t support the transferFile(_:metadata:) method.
but not which error (if any) will actually be thrown when trying to execute transferFile(_:metadata:)
on simulator.
Could somebody share the actual error?
At the moment I'm seeing this:
2022-09-03 13:47:22.742104+0900 JDict[11441:4173123] [WC] -[WCSession notifyOfFileError:withFileTransfer:] <WCSessionFileTransfer: 0x6000039ac0a0, session file: <WCSessionFile: 0x600000fce640, identifier: DB927476-A2CC-4E30-934D-EBC80D2B8CE0, file: /Users/username/Library/Developer/CoreSimulator/Devices/AE8422DC-5FCE-4319-A2B7-E04E3743D424/data/Containers/Data/Application/C738703C-C6E6-472F-8266-3F148F5468C4/tmp/CDF111BE-CD68-4B2F-95A8-BDECB7DD8A10-11441-00000516D3127532, hasMetadata: YES>, transferring: NO> with WCErrorCodeFileAccessDenied
but can't be sure this is not because of another issue. I can't test on real device right now because I don't have a iOS16 phone and watchOS 9 watch right now.
Further, what would be a viable strategy for development on simulator?
I feel like using fixtures on the watch app with #if targetEnvironment(simulator)
seems cumbersome and was wondering about a better solution.
Looking forward to hearing your thoughts!