如何在控制台或文件上获取os x应用程序的输出? [英] How to get the output of an os x application on the console, or to a file?

查看:136
本文介绍了如何在控制台或文件上获取os x应用程序的输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用嵌入式Mono编写一个Cocoa应用程序。我想在Terminal中运行并看到我的调试输出。在可可方面,我使用 NSLog(),而在Mono端,我使用 Debug.Write() 。我可以看到我的调试输出在xcode的控制台,但不在终端。这是我试过的:

 
$:打开/path/build/Debug/MyProgram.app
$:打开/路径/build/Debug/MyProgram.app>输出
$:打开/path/build/Debug/MyProgram.app 2>输出

在终端中,但是我没有在控制台或'ouput'输出。



正确的命令是什么?



PS。我的最终目标是编写一个vim插件来管理,构建,运行,调试xcode项目。如果您可以获得这个 vi输入管理器以使用xcode,您可以节省我这个麻烦。 / p>

解决方案

Chris很好地概述了控制台的工作原理,但是要专门回答您的问题,如果您想直接查看结果在您的终端上,您需要运行作为终端的孩子的内置产品,这意味着使用类似于

  / path /调试/构建/ MyProgram.app / Contents / MacOS / MyProgram 

启动应用程序。 >

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 side I am using Debug.Write(). I can see my debug output in xcode's console, but not in Terminal. This is what I tried:

$: open /path/build/Debug/MyProgram.app
$: open /path/build/Debug/MyProgram.app > output
$: open /path/build/Debug/MyProgram.app 2> output

in a terminal but I do not my output on the console or in 'ouput'.

What's the correct command?

PS. My ultimate goal is to write a vim plugin to manage, build, run, debug the xcode project. You can save me this hassle if you can get this vi input manager to work with xcode.

解决方案

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.

这篇关于如何在控制台或文件上获取os x应用程序的输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆