Is there way to check build from build command instead of play game directly?

How do I know it’s build phase(not play game) from building command in c# script?

This just makes a build. It does not run the built game.