# How to detect where your code is running (Mathematica, Engine, CDF, the Wolfram Cloud, etc.)?

I'd like to include logic to avoid breaking my functions in different environments, like the cloud (which lacks support for many things) or the wolfram engine, or CDF. For example, I'd like a test:

If[!$RunningInCloud, Print @ SystemInformation[]]  Since SystemInformation is not supported in the cloud, what would $RunningInCloud be?

• I think you're looking for \$CloudEvaluation. – Carl Woll Jan 6 at 23:26
• Duplicate of: Detect if code is running in the cloud – Leonid Shifrin Jan 6 at 23:52
• What about the other possibilities: whether it’s in the engine, command line, or subkernel – user5601 Jan 7 at 3:28
• Yes, that’s what I’m also looking for - a unified answer – M.R. Jan 7 at 3:31
• This is not a duplicate question and should be reopened. It is nontrivial to detect if code is running in PlayerPro, or Kernel-only without a Notebook-Frontend. I have struggled with this in the past. – Rolf Mertig Jan 7 at 8:56