"The file "MyApp.app" couldn't be opened because you don't have permission to view it" when running app in Xcode 6 Beta 4
Solution 1
There was a problem with the Info.plist of the project. I created a new project with the same name in Xcode 6 beta 4 and then replaced the real project's Info.plist with the new one. The project then built and ran fine.
Look at the diff, it appears like the plist might have somehow gotten mixed up with a playground's plist. The bundle identifier was "com.apple.dt.playground.iOS-18300-13" and the executable and bundle names were "iOS" along with some other oddities.
This is the full diff in case anyone needs it for reference:
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
- <string>iOS</string>
+ <string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.apple.dt.playground.iOS-18300-13</string>
+ <string>com.myCompany.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>iOS</string>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
- <string>AAPL</string>
+ <string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
- <key>CFBundleSupportedPlatforms</key>
- <array>
- <string>iPhoneSimulator</string>
- </array>
+ <key>CFBundleSignature</key>
+ <string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
- <key>DTPlatformName</key>
- <string>iphonesimulator</string>
- <key>DTSDKName</key>
- <string>iphonesimulator8.0</string>
- <key>LSBackgroundOnly</key>
- <true/>
<key>LSRequiresIPhoneOS</key>
<true/>
+ <key>UIMainStoryboardFile</key>
+ <string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
</dict>
</plist>
Solution 2
I use Xcode6 GM. I encountered the same problem. What I did was to go to Build Settings -> Build Options. Then I changed the value of the "Compiler for C/C++/Objective-C" to Default Compiler.
Solution 3
Having the problem on DEVICE too (not just simulator)?
The other solutions only fixed it for me on simulator, not device.
For me this problem occurred (in Xcode 6) when I would try to change the main info.plist properties whilst trying to change my app name.
In info.plist I had changed Executable File
name to something other than the default ${EXECUTABLE_NAME}
...
I had mistaken this field for the field that changes the name of the app under the icon on the springboard.
Solution 4
In Xcode do the following
Window --> Organiser --> Projects --> The app with the issue --> delete button in Derived Data.
I then cleaned the project and voila
works
Solution 5
For me, a simple Product -> Clean worked great
Related videos on Youtube
![drewag](https://i.stack.imgur.com/oZfgn.jpg?s=256&g=1)
drewag
I am on this forum to learn, and to help others! I thrive on collaboration and sharing of ideas! I am passionate about design, interface, and coding. Interface for me includes the obvious things like user interface and graphics, but also design patterns, API's and on occasion documentation and coding standards :). I work for a dev shop based in Denver, CO called Chronos Interactive as well as on my own app business called Learn Brigade. Check out my Blog Check out my Stack Overflow Career Page Follow me on Drewag
Updated on February 21, 2022Comments
-
drewag over 2 years
Whenever I try to run my app in Xcode 6 Beta 4 I am getting the error:
The file "MyApp.app" couldn't be opened because you don't have permission to view it.
This error appears no matter what simulator or device I target.
I have tried:
- Deleting all Derived Data from Organizer in Xcode
- Repairing permissions on my drive
- Manually elevating the permissions of the built MyApp.app
- Restarting my computer
Has anyone else run into this problem and found a solution?
-
Bamaco over 9 yearsI am getting the same problem with XCode 6.1. At first, the issue was just with the simulator, now, after following some leads in this post, I have the same error running my target phone as well.
-
Srinivasan N over 9 yearsI followed @YuAn solution. It works very well for the simulator. Thanks But when I try to build it on the device, I am still getting the message saying 'I don't have any permission to view it'. The myapp.app file in products directory in xcode and also in derived data directory is showing blocked even after trying to build after deleting the contents of the derived data.
-
Krumelur about 9 yearsAnother (stupid) way to trigger this problem: Compile an app with only resources, and no source files. Don't ask me how I know that :)
-
mazorati over 7 yearsProduct > Clean solve this for me
-
Ravi almost 7 yearsIn my case none of these did not work!! Once I delete pilst file from Xcode and again attach with project, it works like a charm!! Hope help you Guys!!
-
mrunal thanki over 6 yearsI have different solution for it. Please check my answer here stackoverflow.com/a/46546044/5013722
-
monkey0506 about 6 years@Krumelur I just spent hours on that before I stumbled upon your comment. The project in question doesn't need any of its own source code -- it's a standalone game app built from the game engine "framework" and a game data file. The game engine framework is built as a dependency via Xcode, but the app isn't executable unless it has some (redundant/useless) source code of its own. THANK YOU.
-
Mohd Iftekhar Qurashi about 5 yearsI am also facing same issue in the when running app in Xcode 10.1 if any one have better solution please share
-
Jason over 4 yearsWhen cleaning failed to resolve it and my Info.plist settings were already as mentioned in the solutions below, restarting my machine worked like a charm. Good old turn it off and on again :)
-
Narendar Singh Saini almost 4 yearsWhat worked for me is here: stackoverflow.com/questions/24924809/…
-
drewag almost 10 yearsI tried the extreme of giving "everyone" Read & Write permissions but still no luck
-
fingaz almost 10 yearsSo the other thing that I can think of to try is to reset ACLs and Home Folders which I believe is commonly found on the recovery partition by enter resetpassword in the terminal app. But to further troubleshoot you could drag that folder to the shared folder at /Users/ and create a new admin to see if it is user specific.
-
drewag almost 10 yearsthanks for the help! I actually discovered the problem (the info.plist of the project was corrupted)
-
Fede Cugliandolo over 9 yearsThis answer should be marked as the correct one @drewag
-
Slowburner over 9 yearsIn my case, this worked thank you. I'd been changing other similar fields in my <appname>-Info.plist file, and once I'd changed Executable File back to ${EXECUTABLE_NAME} as you suggested, it built and ran.
-
Fabio Napodano over 9 yearsit looks like there are different problems behind this cryptic error message, anyway this is what solved my ptoblem with XCode 6.1
-
nburk over 9 yearsTo clear it up: 1. Go to Build Settings (Choose All and Combined) 2. Search for Build Options 3. Set the Compiler for C/C++/Objective-C to Default Compiler
-
Bala Vishnu over 9 yearsThanks..Same was my case
-
Eric over 9 yearsOne thing to note, is that mine was set to $(EXECUTABLE_NAME) and updating it to ${EXECUTABLE_NAME} fixed the problem for me.
-
Srinivasan N over 9 yearsI followed @YuAn solution. It works very well for the simulator but when I try to build it on the device, I am still getting the message saying 'I don't have any permission to view it'. The myapp.app file in products directory in xcode and also in derived data directory is showing blocked even after trying to build after deleting the contents of the derived data. Any Idea what went wrong?
-
Nilesh Kikani over 9 yearsThanks a lots @Albert Renshaw, youe answer resolved my issue. I am searching solution for that since last two days.
-
Pescolly over 9 yearsGood reminder that sometimes the simple solution is the one that works.
-
zumzum over 9 yearsthis worked for me BUT it keeps happening. I can't continually delete derived data every time I want to run the app in the simulator...
-
WebOrCode over 9 yearsSame problem, name of field is "Bundle display name" for changing name under the icon
-
Jayprakash Dubey over 9 years@Albert : I have default $(EXECUTABLE_NAME) name in Executable file but still getting the same build error..
-
Paul over 9 yearsThis was the answer for me when using SpriteBuilder (Cocos2d-Swift)
-
kiranpradeep over 9 yearsWhy are people up voting this copying of the highest rated answer?
-
Joris Weimar about 9 yearsSame. I had product name set to fixed value. When I changed the target name, the error showed up.
-
Jayprakash Dubey about 9 years@iOSRocks : Welcome buddy!
-
JakeP about 9 yearsThank you, this helped a lot.
-
tonyedwardspz almost 9 yearsI had this issue after upgrading OSX today. This had it sorted in under a minute.
-
endavid almost 9 yearsI tried localizing the Info.plist but then it gave me a build error because it couldn't find the file anymore. I reverted my changes, and then I was getting this "permission" error thing. Since everything was obviously as it was before, the problem wasn't in the Info.plist itself. I cleaned the Build folder as yury.ku suggested and that worked for me.
-
MobileMon over 8 yearsYeah happened to me when trying to change app name. Season developer so just went into plist absentmindedly and changed "Executable File" when in reality I mean to change "Bundle Name"
-
Luca Torella over 8 yearsyep, I had a similar problem. Info.plist file was in the binary file format. Had to convert it
-
Ri_ over 8 yearsI don't know how you discovered this, and it wasn't my exact problem but it lead me to the solution so THANKS!!
-
Ohad Schneider over 8 yearsA similar thing happened to me. My Info.plist was not configured correctly, so XCode took the first
Info.plist
it happened to find in the project's folder, which belonged to some unrelated dependency. -
Tommy over 8 yearsA clean and Xcode restart was required here under Xcode 7.2.1. Cleaning alone progressed me to an "unknown error" with no attempt to build.
-
Alex about 8 yearsthank god, you just saved me hours of pointless Xcode debuggin'
-
Mike Gledhill about 8 yearsThis also fixed it for me. With a "different" application name, the program built, ran, and would even Archive (ready to become an in-house app). But when I attempted to make that in-house app with a manifest file, I'd get an error of "Missing required bundle identifier property in distribution manifest" error. Xcode. Each year giving us another reason to hate it just a little bit more.
-
yeahdixon almost 8 yearsYUP this was it for me too .
-
Jeremy Kelleher about 7 yearsYou can also change the name of Info.plist to FRAMEWORK_NAME_HEREInfo.plist
-
user1105951 about 7 yearsthis helped me. but I thought I can use folder reference. strange.
-
emiliomarin over 6 yearsThis fixed it for me. It happened after I renamed my project. Thanks.
-
Firas Shrourou over 6 yearsThe same here, copying from another projet
-
SLi over 6 yearsYes. This helped me too.
-
chadbag almost 6 yearsThis lead me to my solution, which was I had gotten an extra Info.plist when I included the source for an external library into my code, and they had an Info.plist inside their assets group folder. Removing that extra Info.plist fixed my problem.
-
mkll almost 6 yearsWorked for me too.
-
JerseyDevel over 4 yearsThis is exactly what my issue was. I added another folder of swift files and it had a plist file in there. I deleted that plist file and all is well.. Thank you!
-
Vyachaslav Gerchicov over 4 yearsand? the question is about macOS, you answer for iOS
-
Giriraj.Mulay about 4 yearsI am facing same issue tried various solution but didn't worked for me.. Help will be appreciated
-
Soylent Graham almost 4 yearsI also had this, (missing a main()) but with .cpp, for any readers that may believe the .m or .mm is significant.
-
AZZ over 3 yearsit's worked for me. I finally fixed by deleting the Exclude_Archs. 3q very much! It's what you says, not a permission issue.
-
Ilya Muradymov over 3 yearsfinally! –––– thank you, I've forgot about that setting!
-
pyfyc over 3 yearsIt works for me too in xcode 12.1. However it says that the "Legacy Build System" property will be deprecated in future versions.
-
Arshad Shaik over 3 yearsIt would be better, if you have explained in detail
-
DoruChidean almost 3 yearsUsing the legacy system fixed it for me too. Now I just need to find out how to migrate to the new one
-
jwezorek almost 3 yearslet me know if you figure this out please. I havent tried.
-
salvi shahzad over 2 yearswhere is the issue navigator?
-
Aftab Ahmed over 2 yearsVery well said @jwezorek! If one has run the code in New Build System and have changed to Legacy build system, it was giving this issue. We may have to change it back to Legacy may be once or twice and try again. I had run the code in Xcode 13 where it takes New Build system and had switched back to Xcode 12.
-
ManuQiao about 2 years@salvishahzad the left area of Xcode, where you see build warnings and errors. Cmd+5 is the shortcut under Xcode 13.