Installation
- See More Results
- Run Always App As Administrator Macbook
- Run App As Administrator Mac
- Administrator Mode - Blizzard Support
- Download Visual Studio Code for macOS.
- Open the browser's download list and locate the downloaded archive.
- Select the 'magnifying glass' icon to open the archive in Finder.
- Drag
Visual Studio Code.app
to theApplications
folder, making it available in the macOS Launchpad. - Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options, Keep in Dock.
- I usually do it bit differently than how others described here. Lets imagine you have two users. Standard user: john admin user: kevin. If john is logged in and wants to run as a root user(as kevin) here is how I do it. Su kevin when asked enter kevin's password. Sudo npm 'install' '.' '-force' '-global' enter kevin's password again.
- Go to System Preferences, if you're already on the user whom you want to be Administrator of.
- While you can set up specific programs to always run in administrator mode. The User Account Control is set to pop-up whenever an app or program attempts to make changes to your computer.
- Using Homebrew To Run Unverified Apps on Mac. While Apple would prefer you to install apps through the App Store, you can bypass it completely with Homebrew. The benefit of using Homebrew to install macOS apps is that it bypasses the security mechanisms that Apple uses to “protect” you from unverified apps.
Launching from the command line
I have an application set as a remote app (W2012) that works fine. As long as only one person at a time runs it. In order to set the application to run in multi-user mode, I have to use a switch '/m'. This actually works well, but ONLY if the application (with the correct switch) is run with administrator privs.
You can also run VS Code from the terminal by typing 'code' after adding it to the path:
- Launch VS Code.
- Open the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
- Restart the terminal for the new
$PATH
value to take effect. You'll be able to type 'code .' in any folder to start editing files in that folder.
Note: If you still have the old
code
alias in your .bash_profile
(or equivalent) from an early VS Code version, remove it and replace it by executing the Shell Command: Install 'code' command in PATH command.Alternative manual instructions
Instead of running the command above, you can manually add VS Code to your path, to do so run the following commands:
Start a new terminal to pick up your
.bash_profile
changes.Note: The leading slash
is required to prevent $PATH
from expanding during the concatenation. Remove the leading slash if you want to run the export command directly in a terminal.Note: Since
zsh
became the default shell in macOS Catalina, run the following commands to add VS Code to your path:Touch Bar support
Out of the box VS Code adds actions to navigate in editor history as well as the full Debug tool bar to control the debugger on your Touch Bar:
See More Results
Mojave privacy protections
After upgrading to macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave and is not specific to VS Code. The same dialogs may be displayed when running other applications as well. The dialog is shown once for each type of personal data and it is fine to choose Don't Allow since VS Code does not need access to those folders. You can read a more detailed explanation in this blog post.
Updates
VS Code ships monthly releases and supports auto-update when a new release is available. If you're prompted by VS Code, accept the newest update and it will get installed (you won't need to do anything else to get the latest bits).
Note: You can disable auto-update if you prefer to update VS Code on your own schedule.
Preferences menu
You can configure VS Code through settings, color themes, and custom keybindings and you will often see mention of the File > Preferences menu group. On a macOS, the Preferences menu group is under Code, not File.
Next steps
Once you have installed VS Code, these topics will help you learn more about VS Code:
- Additional Components - Learn how to install Git, Node.js, TypeScript, and tools like Yeoman.
- User Interface - A quick orientation around VS Code.
- User/Workspace Settings - Learn how to configure VS Code to your preferences settings.
Common questions
Why do I see 'Visual Studio Code would like access to your calendar.'
![Run Run](/uploads/1/3/4/2/134252624/276891860.png)
If you are running macOS Mojave version, you may see dialogs saying 'Visual Studio Code would like to access your {calendar/contacts/photos}.' This is due to the new privacy protections in Mojave discussed above. It is fine to choose Don't Allow since VS Code does not need access to those folders.
VS Code fails to update
If VS Code doesn't update once it restarts, it might be set under quarantine by macOS. Follow the steps in this issue for resolution.
Warning: All of the following methods have security implications that users should be aware of. As put by Emmanuele Bassi, a GNOME developer: 'there are no *real*, substantiated, technological reasons why anybody should run a GUI application as root. By running GUI applications as an admin user you're literally running millions of lines of code that have not been audited properly to run under elevated privileges; you're also running code that will touch files inside your $HOME and may change their ownership on the file system; connect, via IPC, to even more running code, etc. You're opening up a massive, gaping security hole [..].'[1]
Avoid running graphical applications as root if possible, see #Circumvent running graphical apps as root.
- 1Circumvent running graphical apps as root
- 2Xorg
- 2.2Alternate methods
- 3Wayland
Circumvent running graphical apps as root
sudoedit
To edit files as root, use sudoedit.
GVFS
Access to privileged files and directories is possible through GVFS by specifying the
admin
backend in the URI scheme[2][3], e.g.:or
Tip: This can also be done from the application location bar/file selector: e.g. in nautilus or gedit, type
Ctrl+l
and then prepend the admin://
scheme to the resource path. The same effect can be attained via the Other locations server address bar.Xorg
By default, and for security reasons, root will be unable to connect to a non-root user's X server. There are multiple ways of allowing root to do so however, if necessary.
The proper, recommended way to run GUI apps under X with elevated privileges is to create a Polkit policy, as shown in this forum post. This should however 'only be used for legacy programs', as pkexec(1) reminds. Applications should rather 'defer the privileged operations to an auditable, self-contained, minimal piece of code that gets executed after doing a privilege escalation, and gets dropped when not needed'[4]. This may be the object of a bug report to the upstream project.
Punctual methods
Those methods wrap the application in an elevation framework and drop the acquired privileges once it exits:
- kdesu(1) (from kde-cli-tools)
- sudo (must be properly configured)
- suxAUR (wrapper around su which will transfer your X credentials)
Alternate methods
These methods will allow root to connect to a non-root user's X server, but present varying levels of security risks, especially if you run ssh. If you are behind a firewall, you may consider them to be safe enough for your requirements.
Xhost
Xhost can be used to temporarily allow root access.
Permanently allow root access
- Method 1: Add the line
to
/etc/pam.d/su
and /etc/pam.d/su-l
. Then switch to your root user using su
or su -
.- Method 2: Globally in
/etc/profile
Add the following line to
/etc/profile
:This will permanently allow root to connect to a non-root user's X server.
Or, merely specify a particular app:
where
appname
https://vtfvbq.weebly.com/blog/best-radio-app-for-mac-2016. is the name of the particular app. (e.g. kwrite)Wayland
Trying to run a graphical application as root via su, sudo or pkexec in a Wayland session (e.g. GParted or Gedit), will fail with an error similar to this:
Mac how to delet app. Before Wayland, running GUI applications with elevated privileges could be properly implemented by creating a Polkit policy, or more dangerously done by running the command in a terminal by prepending the command with
sudo
; but under (X)Wayland this does not work anymore as the default has been made to only allow the user who started the X server to connect clients to it (see the bug report and theupstreamcommits it refers to).Avoid running graphical applications as root if possible, see #Circumvent running graphical apps as root.
A more versatile though more insecure workaround allows any graphical application to be run as root #Using xhost.
Using xhost
This article or section needs expansion.
Run Always App As Administrator Macbook
Reason: Mention that xhost only works under XWayland. (Discuss in Talk:Running GUI applications as root#)
A more versatile —though much less secure— workaround is to use xhost to temporarily allow the root user to access the local user's X session[5]. To do so, execute the following command as the current (unprivileged) user:
Run App As Administrator Mac
To remove this access after the application has been closed:
Administrator Mode - Blizzard Support
Retrieved from 'https://wiki.archlinux.org/index.php?title=Running_GUI_applications_as_root&oldid=632197'