学编程的一大痛苦就是,教你helloworld的那些大牛从不告诉你你自己好不容易编译出来的程序离开了ide怎么运行。好像天底下的人都天生知道似的,好吧也许大牛他们自己知道。或者,程序天生就该离不开ide运行。难道我运行个helloworld这么一行代码的程序也要辛苦几分钟(通常大而慢)等着ide打开再点debug?离不开ide的程序除了教学目的又有什么意义?
网上找个爽快点的介绍mac平台上xcode开发的程序离开xcode运行的教程咋就这么难呢?
下面就谈谈我自己摸索出来的mac平台上xcode开发的程序的部署方法(非苹果官方)。
可以从终端打开图形窗口程序,前提是你知道正确的路径。
从站点https://discussions.apple.com/thread/799529?start=0&tstart=0看到以下提示
However, you can run at least some of the GUI apps from Terminal if you know the proper path. For instance, if you enter the following command into a Terminal window:
/Applications/Preview.app/Contents/MacOS/Preview
the Preview application will start.
对于自己用xcode(3.2.3)开发的cocoa程序可以通过以下方式在终端中打开程序(意味着可以通过复制移植部署)。
例如程序名为HelloCocoa:
1. 在Groups & Files窗口 》Executables找到HelloCocoa。
2. 右键菜单》Get Info 弹出的窗口中找Full Path:
/User