Xcode says “You don't have permission” when trying to run

I found many questions on here asking for the same thing. I have tried all of them but I am still getting this error. I created everything from scratch again and was running well until I deleted the data from "DerivedData" folder and now this permissions alert error came back.


I have been trying following things for a week now:

  1. I have tried copying this project to a new folder. Didn't work.
  2. I changed every permission to my folder structure to be read & write to every user.
  3. Product -> Clean.
  4. Renaming the app.
  5. Compiler for C, C++, Objective-C is "Default compiler Apple LLVM 8.0)
  6. Build Settings > Architectures -> to Standard Architectures
  7. Replaced Info.plist from a newly created project.

Xcode version 8.1.

I see that one of the similar questions were tagged as a duplicate. But I am really stuck here for a week. I have tried everything from this answer in the StackOverflow.

And a lot of others that I found online.

I would really appreciate any help on this. I couldn't finish my project because of just this permission issue.

Thank you in advance!

I forgot to mention that I did 'clean build folder' as well, multiple times. I have a backup as well. Tried with a new project from scratch. When I do a git checkout master, it brings all the files in a folder, then I go run it, it gives me the same error.

I know, I was desperate. But what else would I do? Why does Xcode keeps saying I don't have permission on my own Macbook. So I thought the issue might be real with the permission.

It doesn't look like it is because even though I have full administrator read + write access to my Mac, I still can't run the project.


I have started a project from scratch, git checkout.

I also copied all the .js files over to a new project and then copied the "ios" folder from it. Still the same issue.

I did above steps at least 3 times.


Maybe it is something related to the "ios" folder copying, I am just not sure. I could upgrade to 8.2. But when I upgraded to 8.1, a few more issues had came up so I was waiting on upgrading as I am having so many issues already right before the release.

Thank you for your comment.

I have the same issue - If I run the project a second time the error goes away until I change the text again.


Did you find a fix?


I have logged an issue with apple support - but they are unble to replicate it.

I have the same issue, when I build to Iphone the message appears : "You don´t have permissions to view it" to myapp.app.


I´m using Xcode 8 and OS Sierra on a Mac mini.



Thank´s in advance


Anderson Murakami

I have the same issue, when I build to Iphone the message appears : "You don´t have permissions to view it" to myapp.app.


I´m using Xcode 8 and OS Sierra on a Mac mini.



Thank´s in advance


Anderson Murakami

Hello!


I have the same problem using xcode 7.3 or 8.2 with el capitan on macbook pro.

I am stuck for 3 days. Now I start to wonder if it is because recently updated my developer account. But I can actually build other apps without problem.


I least I am not alone. Thanks everyone!

Delete and recreate the Scheme for your Project.


1) Click on the Project Target Name at the top of the Xcode window.



2) Select "Manage Schemes" and Highlight the Scheme Name and click the Minus Sign to Delete it.



3) Click on the Project Target Name at the top of the Xcode window, Again.


4) The Plus sign at the bottom of the Aut0 Create Scheme and select your project from the list that appears.


This should fix your issue.

I have a MacOS Xcode project and this didn't help 😕😟

Try to check the "Executable file" string. Make it the same as the display name and then clear-rebuild might be help.

Hello

I have the same issue when I am trying to run the app in device or simulator and getting the same issue in Xcode 10.1


`The file “AppName” couldn’t be opened because you don’t have permission to view it You don’t have permission.`

If any one have better solution please share with us

Does anybody have an answer for this issue yet?
These permission errors occurred with a project opened in Xcode 12 beta. Then when opening the project in Xcode 11, everything was fine.
I'm using a run script (Target -> Build Phase -> Run script) which strips out all architectures that are not currently needed.

/bin/sh executing the script which executes lipo.
lipo tries to remove/create files which doesn't work due to missing permission.

Because of that Xcode 12.0.1 on Catalina 10.15.6 shows
"The file "name.app" couldn't be open-end because you don't have permissions to view it."

I can't change the permissions as the files/folders doesn't exist prior the compile.
Changing the permissions afterwards doesn't work because Xcode doesn't run the script again.
On "Clean build Folder" the files/folders are removed and so on.

How do I grant access for Xcode/sh/lipo on a folder which doesn't exist?


I am facing same problem as Morfing on Xcode 12, as soon as I updated the version I started facing the issue, anyone knows how it could be solved?

I have the same issue when trying to launch an app on a simulator using debug executable. If I run non debug executable, I stop getting this issue, but have an installation problem. But even if I was able to run the non debug version it would make things very inconvenient, since I need all the debug tools. This seems like its a problem with Xcode think that Im just a user and not a developer.
My Xcode version is 12.0.1 and I have added a developer Apple ID to Xcode preferences. I also have developer certificate attached to my keychain.
For anyone still looking to a solution to this, at least for my situation, this happened because my product name was not exactly the same as my project name. Once I changed the Product Name field under Build Settings to perfectly match my project name (or target name, scheme name, not sure what it actually cares about) this error went away.
Stuck with same issue after upgrading to XCode 12.4 and try to build an old project from prior versions
Issue went away after putting "x86_64 armv7s arm64" in VALID_ARCHS for project in 12.4 (12D4e), this is contrary to some posts that suggest VALID_ARCHS should be empty. I went back to the old project and isolate which change I did when migrating the old project to 12.4 that exposed the permission error. The error message and logs are misleading.
Fixed by adding "x86_64 arm64 armv7 armv7s armv6" to my VALID_ARCHS.

I had the same problem. Nothing helped just one thing helped. I copied folder with my project to my flash drive and deleted it from my Mac. After tried it on my flash drive, it worked. Then copied it from my flash drive to my Mac and it worked also.

Any solution to this problem? I stuck in this problem for 2 days :(

I ran into a similar issue only after migrating to a new Mac. For me it appears that Xcode is not giving all of my executables execute permission resulting in the same error. Using 'chmod +x' seems to 'fix' this at least until the next clean/build. I have not yet verified, but it also appears that the affected projects were created using CMake. Otherwise, I have not found the cause.

I do hope this helps someone... Upgraded XCode from an old version to the version that works with El Capitan. Got the same error after messing with the info.plist file. Reverted that file back and still had this new problem when trying to run code in the simulator. The solution for me was to rename the Product Name in Build Settings - I changed a space for an underscore. That didn't work, I then changed it back exactly as it was originally (with a space) and it worked?!?!

For anyone still having permission issues with this ,Here is what I did after trying all day. First since I was moving files from Xcode 12.1 to 14.3 on different machine, it seems to have been permissions issues and pod versions.

So removed all the pods and pod install and it worked .

I got this confusing issue... I resolved this issue by find the "<projetname>.xcodeproj" file in the Finder and open it 🤷‍♂️

  1. open the terminal

  2. go to terminal und made sudo chmod -R 777 public

  3. In Xcode under build setting set sandbox scripting no

voila its buiding and u can testing over the testflight

Xcode says “You don't have permission” when trying to run
 
 
Q