Set DOTNET_CrashReportRootPath=... before loading CoreCLR.
Ref: #128738.
Criteria:
- The location should not be automatically backed up (iCloud).
- The location must be writable.
Which means there are two main candidates:
- NSTemporaryDirectory
- NSCachesDirectory
It's not documented as such, but the wording on Apple's site seems to indicate NSTemporaryDirectory is cleared more often than NSCachesDirectory, so we're choosing the latter, NSCachesDirectory.
For all sandboxed apps, this is an app-specific directory, we can set it as-is.
For non-sandboxed apps (which only happens on desktop), we need to use NSCachesDirectory/<CFBundleIdentifier>
This seems like the best way to detect if we're running in a sandbox or not: https://stackoverflow.com/a/47105177/183422
Set
DOTNET_CrashReportRootPath=...before loading CoreCLR.Ref: #128738.
Criteria:
Which means there are two main candidates:
It's not documented as such, but the wording on Apple's site seems to indicate
NSTemporaryDirectoryis cleared more often thanNSCachesDirectory, so we're choosing the latter,NSCachesDirectory.For all sandboxed apps, this is an app-specific directory, we can set it as-is.
For non-sandboxed apps (which only happens on desktop), we need to use
NSCachesDirectory/<CFBundleIdentifier>This seems like the best way to detect if we're running in a sandbox or not: https://stackoverflow.com/a/47105177/183422