如何从命令行加载和启动 Google Chrome 应用程序?
How to load-and-launch a Google Chrome App from the command line?
At this link,上面写着:
These command line options to Chrome may help you iterate:
--load-and-launch-app=/path/to/app/
installs the unpacked application from the given path, and launches it.
完整的命令行语句是什么?
例如是:
$ chrome --load-and-launch-app=/path/to/app/
或者也许:
$ cca --load-and-launch-app=/path/to/app/
具体来说,整个命令是什么?
你掌握的基本命令是正确的
/Path/to/Chrome --load-and-launch-app=/Path/to/App
假设您正在使用 Mac、OSX(来自您的评论)并且您以正常方式安装了 Google Chrome,(进入您的应用程序目录),您的/Path/to/Chrome 将是
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
但要确保您可以 您的 Google Chrome 应用程序直接进入您的终端(假设标准 MacOSX 终端或 iTerm)
对于命令的 /Path/To/App 部分,使用包含 manifest.json 文件的目录。
例如,如果 manifest.json 文件的路径是
/Users/[Your Username]/Downloads/basic/manifest.json
你可以从这个 link
加载和启动 "Basic" google chrome 应用程序的命令是
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-and-launch-app=/Users/[Your Username]/Downloads/basic
一个可能有用的附加细节:应用程序的路径必须是绝对路径,从根目录 (/
) 开始。
你必须做--load-and-launch-app=/Users/YourUsername/Documents/my_chrome_app
或者,如果您不想键入整个路径,您可以使用 $PWD
,它计算出您的当前目录(必须从与您的 manifest.json 相同的目录执行命令):
--load-and-launch-app=$PWD
你做不到--load-and-launch-app=.
你不能做 --load-and-launch-app=~/Documents/my_chrome_app
At this link,上面写着:
These command line options to Chrome may help you iterate:
--load-and-launch-app=/path/to/app/
installs the unpacked application from the given path, and launches it.
完整的命令行语句是什么?
例如是:
$ chrome --load-and-launch-app=/path/to/app/
或者也许:
$ cca --load-and-launch-app=/path/to/app/
具体来说,整个命令是什么?
你掌握的基本命令是正确的
/Path/to/Chrome --load-and-launch-app=/Path/to/App
假设您正在使用 Mac、OSX(来自您的评论)并且您以正常方式安装了 Google Chrome,(进入您的应用程序目录),您的/Path/to/Chrome 将是
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
但要确保您可以
对于命令的 /Path/To/App 部分,使用包含 manifest.json 文件的目录。 例如,如果 manifest.json 文件的路径是
/Users/[Your Username]/Downloads/basic/manifest.json
你可以从这个 link
加载和启动 "Basic" google chrome 应用程序的命令是
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-and-launch-app=/Users/[Your Username]/Downloads/basic
一个可能有用的附加细节:应用程序的路径必须是绝对路径,从根目录 (/
) 开始。
你必须做--load-and-launch-app=/Users/YourUsername/Documents/my_chrome_app
或者,如果您不想键入整个路径,您可以使用 $PWD
,它计算出您的当前目录(必须从与您的 manifest.json 相同的目录执行命令):
--load-and-launch-app=$PWD
你做不到--load-and-launch-app=.
你不能做 --load-and-launch-app=~/Documents/my_chrome_app