One of our command line parameters isn’t working and I can’t figure out why so I need to run the game through the editor with a command-line argument and debug what happens. I can’t seem to find any where I can enter command line parameters in the editor - is there even a way to do this?
I don’t think it is possible. But I suggest two solutions to find the problem:
-
Debug your application. This is the best option, because you’ll be checking actual running process, which might behave slightly different than in play mode in Unity. Please check official docs for more info on debugging.
-
You’re probably using Environment.CommandLine property or Environment.GetCommandLineArgs() method to retrieve your arguments. You can temporarily change it in your code, to return hard coded values. For example you can return
“MyGame.exe param1 p2 333”
instead of Environment.CommandLine, or
new string[] { "MyGame.exe", "param1", "p2", "333" }
instead of Environment.GetCommandLineArgs().
And remember that first value in both is actual executable name, not a first argument passed to it.