How to get the output of an OS X application on the console, or to a file?

前端 未结 4 1576
离开以前
离开以前 2020-12-04 14:44

I am writing a Cocoa application with Mono embedded. I want to run and see my debug output in Terminal. On the Cocoa side I am using NSLog(), and on the Mono s

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 15:04

    Chris gave a good overview of how the Console works, but to specifically answer your question: If you want to see the results directly in your Terminal, you need to run the built product as a child of the Terminal, which means using something like

    /path/debug/build/MyProgram.app/Contents/MacOS/MyProgram
    

    to launch the app.

提交回复
热议问题