Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Xcode 中有一个使用 Core Data 的控制台应用程序,应该从控制台获取一个参数。问题是它在没有打包到 .app 文件的情况下构建。所以我什至不能从终端启动它,甚至不能给它传递一个参数。也许我错过了一些项目设置,允许我这样做?
您应该在应用程序中运行实际程序,例如./MyProgram.app/Contents/MacOS/MyProgram,如果您位于包含 .app 的目录中。
./MyProgram.app/Contents/MacOS/MyProgram
open -a "./MyProgram.app/Contents/MacOS/MyProgram" --args myarg