dofile and loadstring on desktop

dofile and loadstring both appear to work on desktop builds. 

loadstring but not dofile appears to work in the simulator.

Am I correct in that both will not work on mobile devices? I was under the impression that none of those functions would work, though I was pleasantly surprised to discover that they work on desktop as I am exploring options for adding desktop modding to our game.

Is this expected behavior? Are there limitations placed upon desktop builds by Corona that may limit custom mod code?

Only loadstring is enabled for device builds other methods like dofile are not. This is due to a long standing Apple requirement to not let apps program themselves. 

Rob

That is not consistent with the tests I have run. dofile works fine when I run a macOS build, I am able to target lua files in the system.DocumentsDirectory. I can attach a simple project that demonstrates this if need be. Mind you, I am happy that I am able to do this on desktop as it gives me more options to enable mods on desktop. I understand why this is a limitation on mobile.

Sorry, I’m not sure I was clear:  device builds = iOS & Android.  macOS is a desktop build and Apple is less restrictive with desktop builds than they are with mobile builds.

Rob

Ah, sorry for the confusion. Thanks!

Only loadstring is enabled for device builds other methods like dofile are not. This is due to a long standing Apple requirement to not let apps program themselves. 

Rob

That is not consistent with the tests I have run. dofile works fine when I run a macOS build, I am able to target lua files in the system.DocumentsDirectory. I can attach a simple project that demonstrates this if need be. Mind you, I am happy that I am able to do this on desktop as it gives me more options to enable mods on desktop. I understand why this is a limitation on mobile.

Sorry, I’m not sure I was clear:  device builds = iOS & Android.  macOS is a desktop build and Apple is less restrictive with desktop builds than they are with mobile builds.

Rob

Ah, sorry for the confusion. Thanks!