简体   繁体   English

运行Mac应用程序的C程序

[英]C Program to run Mac Application

What should be the command used in C Program to run a Mac Application (.app) that is built from Xcode? 在C程序中运行从Xcode构建的Mac应用程序(.app)时应使用什么命令?

Is this the right way of doing it: 这是正确的方法吗?

system(MyApp.app);

I don't use Mac often. 我不经常使用Mac。 But I am almost positive that you can't just execute a .app file and have it run. 但是我几乎可以肯定,您不能只是执行.app文件并使其运行。 You need to do it with the open command: 您需要使用open命令:

system("open /path/to/MyApp.app");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM