Local CoreML Model Encryption in Simulator

Hello,
When trying to load my CoreML model which is encrypted, I am getting:

Code Block
Error loading model: Error Domain=com.apple.CoreML Code=9 "Operation not supported on this platform." UserInfo={NSLocalizedDescription=Operation not supported on this platform.}.


When using the simulator. Can this only be tested on an actual device?

Thank you,

Andres
I have got the same issue as above. It would be great if someone from Apple can answer this question.

It look like the simulator can not decrypt the model.

I found a solution by adding "encrypt" flag only on release build.

First add user-defined setting in Build Settings And then edit the per file compile flags and set them to $(ML_MODEL_ENCRYPT)

https://stackoverflow.com/questions/78956706/per-file-compile-flags-in-xcode-but-only-for-release-builds

Local CoreML Model Encryption in Simulator
 
 
Q