The console app flag is setting set true when running a GUI app. The method testMode() always returns true , at least when running from the command line or in the IDE.