Unable to install VS Code for Mac - macos

I have downloaded VS Code for Mac, but I'm unable to install it on my MacBook. I get the following error:
"Visual Studio Code - Insiders" can't be opened because Apple cannot check it for malicious software.
Here is a sreen shot of the full error message:
How can I get VS Code to install and run?

The problem is caused by macOS requiring apps to be notarized by Apple. The best way around this problem is to simply right-click on the app and select Open. If this doesnt work, first move the app to the Applications folder. Then open Terminal and paste and execute the following command:
xattr -d com.apple.quarantine /Applications/Visual\ Studio\ Code.app
This should remove the quarantine on the app and allow you to run it.

Related

Can't run app because of permission in macOS v11 (Big Sur) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 months ago.
Improve this question
I installed macOS v11 (Big Sur) yesterday and since then I am not able to run some old application. This is the message I get:
You do not have permission to open the application
I think this application is from an unknown developer.
I tried different methods that were working in macOS v10.15 (Catalina) like:
spctl --master-disable
Or I tried also to disable SIP and AMFI.
I've also tried:
sudo xattr -rd com.apple.quarantine /Applications/my_app.app
If I run the application from the terminal, this is the text version of the error I get:
The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10826 "kLSNoLaunchPermissionErr: User doesn't have permission to launch the app (managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, _LSLine=2508, NSUnderlyingError=0x7fcb24c13ec0 {Error Domain=RBSRequestErrorDomain Code=5 "Launched process exited during launch." UserInfo={NSLocalizedFailureReason=Launched process exited during launch.}}}
Also tried to disable encryption and run:
csrutil authenticated-root disable
This is the error window:
I had this problem with the error "Termination Reason: Namespace CODESIGNING, Code 0x1" and I managed to open the application after I signed it again on that machine, with the command:
codesign --force --deep --sign - /Applications/AppName.app
No other solution worked for me.
It seems to be a permissions issue on one of the files deep in the .app that you moved to the applications directory.
Open Terminal or iTerm and type "chmod -R 755 " and drag the .app into the window, which will bring the full path into Terminal or iTerm.
It will look like this:
chmod -R 755 Path\ to\ app\ file.app
Press return
Then, you can open the app file normally, but it will fail because gatekeeper won't be able to verify the file. From there, go into your "Security and Privacy" in "System Preferences" and then click to allow the app to open.
The problem in my case it was related to a Big Sur problem where UPX compressed binaries are not recognised properly, so they were not executed with a permission error.
There is some more information here: UPX compressed application fails to start on latest macOS release: Big Sur 11.01 #424
So the solution is to unpack the binary with UPX and run it normally.
Install upx with Homebrew (executable brew):
brew install upx
Now run this command:
sudo upx -d /Applications/my_app.app/Contents/MacOS/my_app
(Please note you have to specify the full binary path.)
You should use the path of your binary instead of "/Applications/my_app.app/Contents/MacOS/my_app"
Then run the application normally.
I found a solution:
You need to resign the app,
(install Xcode tools, if necessary):
xcode-select --install
sudo codesign --force --deep --sign - /Applications/YourAppName.app
Move the app to quarantine:
sudo xattr -d -r com.apple.quarantine /Applications/YourAppName.app
Go to /Applications/YourAppName.app/Contents/MacOs and make the file inside executable:
sudo chmod +x Script_name
That worked for me and the app launched.
This answer will only apply to a specific set of applications
I had this issue with a universal binary (Terminal) that I duplicated and explicitly set in the info "Open using Rosetta" to run x86 tools like Homebrew. After updating to 11.0.1 from 11.0.0, the x86 version of the terminal stopped working with the above error.
I simply had to delete the duplicate, created another duplicate of the terminal and enabled Rosetta again.
First figure out that your application signature is valid:
From Apple's official website:
All apps in the App Store are signed by Apple to ensure they have not been
misused or tampered with. Apple signs any app that comes with Apple
devices.
To check this out, you can type the following in your terminal (the path of Folx.app is just for an example and you should replace it with your desired app):
pkgutil --check-signature /Applications/Folx.app
if you get an "invalid signature" responce, something like this:
Then your app maybe was installed in some hacky way! And now your easiest approach is to uninstall the app and reinstall it again.
Otherwise, you will have plenty of hard time to enjoy (šŸ˜Ž) with that app, Xcode, and signature stuff...
You have to run SUDO xattr -d com.apple.quarantine <app>. It's important that you don't forget sudo or it won't work.
This is the only solution that worked in my case.
Download macOS-GateKeeper-Helper.
Open GateKeeper_Helper.command by double-clicking on it (if it says untrusted developer, go ahead and run it from Settings - Security & Privacy - General - Open Anyway)
Select Option 4 (Remove app from GateKeeper quarantine)
Drag and drop the app file from the Applications folder, hit the Return key, and enter your password
You will see a message like ā€œApp removed from quarantineā€. Thatā€™s it. Try to open the app as usual.
If you are uploading an Xcode app to GitHub releases, make sure to compress it first on your computer, don't let GitHub compress it.
For my team, this turned out to be a problem with Git adding CRLF to the Entitlements.plist file.
Once I fixed the .gitattributes file to only use LF with p-list files, I built a new app and had it codesigned and it worked--no aborts. I also had to make sure Jenkins wiped the workspace since it didn't seem to fix the file at first.
I encountered this issue when sending to a colleague for testing a Mac app that I developed. He tried some of the suggestions on this forum, but they didn't seem to work (and we're both on Intel, so the Rosetta tips didn't apply).
What ultimately worked for me was creating a blank disk image, and then adding the .app file to the image and then sending him the disk image. It seems like the problem comes up when the .app file is compressed, and adding the file to a disk image first seems to help prevent the issue.

ā€œqmakeā€ cannot be opened because the developer cannot be verified

I'm trying to install the omnetpp simulator abut I was not able to use its graphic interface. To run it properly I have to install Qt5 which I did through homebrew. My Qt version is 5.15.0 and my MacOS is Catalina (10.15.5 (19F101)).
When running the ./configure command to install omnetpp, I got the following error:
ā€œqmakeā€ cannot be opened because the developer cannot be verified.
In summary I had problems with the omnetpp when trying to run the graphic interface Qt, then I've installed Qt5 and now I get an error telling me that qmake cannot be verified.
Thanks,
The problem is that this will come many times... It has something to do with the new security settings for MacOS Catalina.
I found another work-around, which worked very well for me. Go to Systems Preferences -> Security and Privacy -> Privacy. Scroll down the left menu to Developer Tools and allow Terminal to run software locally (tick the box).
I was able to circumvent this problem by opening System Preferences, Security & Privacy, General, and then allowing the file to be executed. When I ran make again the Qmake command ran without any warnings or windows popping up.
According to Apple's website, you need to find qmake in the Finder, CTRL+click on it and press "Open". After that, qmake will be marked as an authorized app and you can run ./configure again.
I am a Windows user and could find the official Apple support page (https://support.apple.com/de-de/guide/mac-help/mh40616/mac) within a minute of googling, by the way.
You can run the following command to "un-quarantine" your binary (assuming its path is /usr/bin/qmake):
xattr -w com.apple.quarantine "00c1;$(xattr -p com.apple.quarantine /usr/bin/qmake | cut -d";" -f2-4)" /usr/bin/qmake

Unable to open LiClipse 6.1.0 on MacOS/Catalina (10.15.3)

I have downloaded LiClipse 6.1.0 from http://www.liclipse.com/download.html three times (to ensure that I don't have a corrupt/damaged file) and installed it on a MacPro Notebook with MacOS Catalina (10.15.3). I have followed the installation instructions at http://www.liclipse.com/download.html for Native Mac OS Install, but every time I get "ā€œLiClipse.appā€ is damaged and canā€™t be opened. You should move it to the Trash."
Since it gets installed without any problem, I think that downloaded file is not corrupted/damaged, but when opening it I always get the warning about its being damaged even when I have run sudo spctl --master-disable to enable apps from "Anywhere" to run.
I would appreciate if anyone who had succeeded in opening it on a MacPro/Catalina would share his/her steps. Thanks.
You can try removing the quarantine flag (when Mac downloads a file it marks it as quarantined and it won't run unless it has an Apple signature -- which LiClipse doesn't have, so, Apple is making it always a bit harder to run files you download).
To remove the quarantine flag, run:
xattr -d com.apple.quarantine <FILE>
(<FILE> being /Applications/LiClipse.app and maybe /Applications/LiClipse.app/MacOS/LiClipse too -- I don't really have Catalina to check).

Not able to copy and install android studio on mac

I have downloaded android stdio setup from android developer site i.e. https://developer.android.com/studio/?hl=ja#downloads of version 3.1.2.
When I started the installation, it ask for copy android stdio to "Application" folder. when I do that mac give error like
"The operation canā€™t be completed because you donā€™t have permission to access some of the items."
Please let know how to install.
I also faced similar issue.
Solution:-
Drag it to Desktop. Then move it to Applications folder. and it will work fine.
Best of luck
I tried the above solution and it did not work. I got it to work by accident. The last action i did was:
Drag the .dmg into the Applications folder, and back into Downloads
Drag the Android Studio icon into Applications and it worked.
I had similar issues.
First, repair disk permissions with Disk Utility, for both volumes!
If that doesn't fix the problem, then right-click (or control-option-left click) on the folders. Then select Get Info, and then check the Sharing & Permissions for them. There you want to see Read & Write, in case you see Read Only, then change it!
Source: https://discussions.apple.com/thread/3002619
Problem:
Had the same issue with the installer getting to 528MB and then the same error as in your screenshot:
"The operation can't be completed because you don't have permission to access some of the items."
Solution:
I was installing version 3.1.4 so change the below so that the paths are correct:
sudo rsync -rvzPKh /Volumes/Android\ Studio\ 3.1.4/Android\ Studio.app /Applications/
That will copy all the files into place, but you will still get an error related to a missing dylib if you try launch via terminal.
For some reason there is a symlink that does not get copied over so we have to patch that:
cd /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/MacOS
sudo ln -s ../Home/jre/lib/jli/libjli.dylib libjli.dylib
Now just launch the app from Applications as you usually would. That should get you moving.
Also:
Personally, I've been having other issues with my other intellij platforms like PyCharm and WebStorm that give me an error intermittently when I try to launch them. Namely a popup containing:
Start Failed: Internal error. Please report to https://code.google.com/p/android/issues
java.lang.ClassNotFoundException: com.intellij.ide.plugins.PluginManager
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:227)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:36)
at com.intellij.idea.Main.main(Main.java:83)
However since I feel this issue is specific to me I think it might work for some of you out there. Would be interested to know if this works for anyone, please let me know in the comments.
I have the same problem yesterday and here's how I solve it today.
open the terminal.app
enter "sudo spctl --master-disable" and enter the password
System Preferences -> Security & Privacy -> Allow apps downloaded from: -> select "Anywhere"
install again, and it will be fine.

Code command terminal interface on macOS of Visual Studio Code not works after restart system

I use the command on terminal code file.txt to open file with Visual Studio Code, but when I restart the system, the command stop works. And I need open Visual Studio Code, and reconfigure path to use the code command line interface.
How I can fix this? I'm using macOS HighSierra.
After I restart the system the command apparently fade.
-bash: code: command not found
So your issue may be related to how you installed VSCode
I would run below to install the same
brew cask install visual-studio-code
If you don't want to use brew then I would download the app from below link
https://code.visualstudio.com/docs/?dv=osx
And after unzipping move it to Applications folder in finder.
There may be a possibility that MacOS Gatekeeper is interfering with the location of your app after every restart. Which means the symlink gets invalidated every restart and hence the issue
If the problem still happens after restart, you want to exclude VScode out of gatekeeper
spctl --add "/Applications/Visual Studio Code.app"
Try to repeat again what is described in official documentation.
Check whether Visual Studio Code is installed in the correct folder with the command: ls -l /usr/local/bin/code.
You can find out correct path by running the command which code or where code in bash.
If the command returns path like that: /usr/local/bin/code -> /private/var/folders/xf/vnnm636d0k92w3sc7lm95w040000gn/T/AppTranslocation/3815E4B6-43DB-0F8E-AAB9-EDE3AC7F67CC/d/Visual Studio Code.app/Contents/Resources/app/bin/code
/usr/local/bin, it means that the program was installed in a temporary folder.
The path must be: /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code.
If the program was installed in a temporary folder, this could cause this problem.
Drag Visual Studio Code.app to the Applications folder and repeat
instructions from the official documentation.
If after the above described still does not work and the program is not installed in a temporary folder, it is advisable to check bash settings in ~/.bash_profile and ~/.bash_profile.
P.S.
Also, if none of the above does not help, you can try the following: sudo ln -fs "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" "/usr/local/bin/".

Resources