Launch a Chrome app from command line
Solution 1
Answered thanks to @JacobVlijm .
To run a chrome app from command-line, use the following :
google-chrome --app-id=[app_id]
Assuming the path of google-chrome
is /opt/google/chrome/google-chrome
.
To retrieve the app id, search the first occurrence of the application name in /home/$USER/.local/share/applications
.
Solution 2
After all the stuff I have executed following command, worked for me and open postman
google-chrome --app-id=fhbjgbiflinjbdggehcddcbncdddomop
Assume default configurations
Pattern: google-chrome --app-id=<extensionID>
To get the extension ID:
- open
chrome://extensions/
in your chrome browser - click "Details" button of Postman extension
- view address on address bar, where url in format of
chrome://extensions/?id=<extensionID>
Copy extensionID from url and use it in command
In same way you can use any extension of google chrome
Related videos on Youtube
chalasr
Updated on September 18, 2022Comments
-
chalasr over 1 year
I can't find how to launch a chrome app from a bash ?
I'm trying to achieve this with Postman.
From
google-chrome -h
, I tried (unfortunately) those ones :$ google-chrome --app="Postman" $ google-chrome --extension="postman"
The result is that a new blank window is opened.
My first guess is the app is stored on my machine and I need to open a specific file (the app index) to launch it.
Is it possible to achieve this ?
And if it's possible, how to do ?
-
Jacob Vlijm about 8 yearsProbably if you open the corresponding
.desktop
file in~/.local/share/applications
(drag it over an opened gedit window) you can see the correct command in theExec=
line. -
chalasr about 8 yearsPerfect, thank you @JacobVlijm . The command use the
--app-id=[id]
I assume this id is permanent so I will create an alias, but do you know a way to launch it by its name ? -
d a i s y almost 7 years@JacobVlijm Why the question is not duplicate of What command should I type to run Chrome from the terminal?
-
chalasr almost 7 years@daisy because that's not the same question. This is about how to launch a chrome application, not chrome itself.
-
-
Jacob Vlijm about 8 yearsPerfect, didn't have time to post an answer, but still wanted to help out :)
-
BarathVutukuri almost 7 yearsYou can even get the app id from the Chrome Store URL for the particular application. Of course this works only if you have access to the internet :)
-
Vidar S. Ramdal almost 5 yearsIf you have multiple Chrome profiles, you need to add the profile directory to the command line, too:
google-chrome --profile-directory=Default --app-id=[app-id]
-
yosefrow about 4 yearsYou can get an app id by 1.
xprop WM_CLASS | sed -E 's/^.*crx_([a-z]+)".*$/\1/g')
2. click the app