问题
I'm trying to open google chrome mac with disabled security with the command line
open -a Google\ Chrome --args --disable-web-security
However it keeps opening up parallels windows chrome instead - how do I remove the parallels binding for chrome so that it doesn't open from mac terminal?
回答1:
Use the full path to the application:
open -a /Applications/Google\ Chrome --args --disable-web-security
Parallels creates folders in ~/Applications for each virtual machine. These folders contain aliases for applications on the virtual machine. My guess is that the command "open -a" is searching the folder ~/Applications before searching the folder /Applications. This is probably desired behavior in many cases - open would find the application installed for the user before finding the application installed system-wide. However, it's causing some confusion in this case.
I couldn't find documentation explaining which path "open" is actually searching, so this is just a guess. However, specifying the full path to the application works for me.
回答2:
I had this issue while trying to launch the Chrome debugging tools from React Native. Because React was launching the app I couldn't adjust the command it issues as described in the accepted answer.
I fixed it by changing the bundle name in the Parallels application package so it was different than the Mac Chrome version. To do this find the application package for Chrome in Parallels - I found mine in ~/Applications (Parallels)
.
Right-click on the Chrome application in Finder and select Show Package Contents
. Under the Contents folder you should find a Info.plist
file. Open this in a text editor and modify the string value for the CFBundleName
key to something else (I used "Google Chrome Win").
Save the file and the open
command should launch the Mac version of Chrome as expected from then on.
来源:https://stackoverflow.com/questions/27708660/remove-parallels-binding-to-a-command-line-open-app-command