简体   繁体   English

如何通过终端在xcode中打开.playground文件?

[英]How to open .playground file in xcode via a terminal?

I just learned the basics of the Terminal, so I was trying to open a file named trees.playground by following command: 我刚刚学习了终端的基础知识,所以我试图通过以下命令打开一个名为trees.playground的文件:

open trees.playground

But terminal says: 但终端说:

No application knows how to open trees.playground.

How to make the terminal aware that XCode can open such file? 如何让终端知道XCode可以打开这样的文件?

Xcode should be the default opening application for .playground files. Xcode应该是.playground文件的默认打开应用程序。 So following command should work: 所以跟随命令应该工作:

open trees.playground

If it still does not, you can just force terminal to open it with Xcode like following: 如果它仍然没有,你可以强制终端用Xcode打开它,如下所示:

open -a Xcode trees.playground

To make you understand the above mentioned command, I will break it down: 为了让你理解上面提到的命令,我将其分解:

open [Open something]
-a [With application]
Xcode [Name of desired application]
trees.playground [This file]

In Verbose form, it would mean "Open tree.playground with an application named Xcode". 在详细形式中,它将表示“使用名为Xcode的应用程序打开tree.playground”。

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

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