DEV Community

Bartłomiej Stefański
Bartłomiej Stefański

Posted on • Originally published at bstefanski.com on

🛠️ Quickly Launch VSCode from Terminal as Admin (2023)

I wanted to utilize the code . command in the terminal to directly open VSCode in my desired directory. To achieve this, I navigated to the VSCode Command Palette and chose >Shell Command: Install 'code' command in PATH. However, I encountered an error message stating "permissions denied" and that administrator access was required for this action.

After some searching, I discovered several solutions to run VSCode as an administrator. The following command was the only one that worked for me:


$ sudo /Applications/Visual Studio Code.app/Contents/MacOS/Electron; exit

Enter fullscreen mode Exit fullscreen mode

Upon executing this command, VSCode should open, allowing you to select the >Shell Command: Install 'code' command in PATH option.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay