Permission Denied when running Mac app after upgrading to XCode 4.4

11,070

Solution 1

I found this on an iPhone 5 (iOS 6.0) newly set up for development. I had to manually launch the app on the phone, and it said "Are you sure you want to launch this app signed by this devloper?" Once I approved that, the "permission denied" went away and it now launches from Xcode.

Solution 2

Unlock the Device

Try simply unlocking your device before running on it. I was stumped by this very same issue. Upon building and running with no changes to OS, environment, code, etc., I was receiving the error.

Similar questions have been asked here and here, but were not helpful in this situation.

Solution 3

This is caused by an entitlement (and, presumably, having the wrong kind of certificate for it).

  • If you have the sandbox enabled, and try to sign with a Developer ID certificate, your application will crash on launch (as of Lion—I haven't tried this on Mountain Lion).
  • If you have iCloud enabled, and try to sign with a Developer ID certificate, your application will not launch at all—in Xcode, you'll get the error message in the question, and in Finder, the application will launch ever so briefly and then get SIGKILLed.

Presumably, there is a right kind of certificate with which one can sign an app in order to be able to test with a sandbox and maybe even iCloud that you can obtain if you have a Mac Developer Program membership. A Developer ID certificate is not that kind of cert.

(That solves my problem, anyway. Dennis, what kind of cert were you trying to sign with?)

Share:
11,070
Dennis
Author by

Dennis

Updated on June 21, 2022

Comments

  • Dennis
    Dennis almost 2 years

    I had a working Mac application until I updated to XCode 4.4 and Mountain Lion. Now the application still compiles, but when I try to run it I get an error message.

    error: failed to launch '/Users/username/James/mac/Browser/trunk/Browser/DerivedData/Browser/Build/Products/Debug/Browser.app/Contents/MacOS/Browser' -- Permission denied*
    

    Can anybody explain why I might be getting this?

  • Old McStopher
    Old McStopher over 11 years
    I'm guessing that Xcode is finally honoring the lock screen. (Am I right that it didn't before?)
  • Dennis
    Dennis over 11 years
    I apologize that I didn't make my initial post clear. This is an OSX application, not iOS.
  • Old McStopher
    Old McStopher over 11 years
    Ah, well that certainly makes a difference. I'll leave the answer here for others who Google to this.
  • ski_squaw
    ski_squaw over 11 years
    I ran into this problem too. I tried to code sign a Mac OSX app with my iOS developer id. It didn't like it. Now I guess I'll have to pay the $99 for Mac Developer access to test my iCloud stuff...ack
  • Nico
    Nico over 11 years
    I already have it set that way (it's the default on Lion) and still had the problem.
  • Nico
    Nico over 11 years
    GateKeeper is off by default on Lion (even on versions where it is present—since 10.7.4 or 10.7.5). My Mac was not in developer mode, but I turned that on and it did not help.
  • Nico
    Nico over 11 years
    My Home folder is on another volume, but “ignore permissions” is not turned on. I haven't tried it from an all-on-the-boot-disk account. • The problem only happens with code signing turned on, with either iCloud or sandboxing enabled—see my answer. • This was building with Xcode itself, so CLI tools shouldn't be an issue. • Good thought! But no, no phases outside of the standard five. • Home folder disk was pretty close to full at one point, but is nowhere near it now and the problem still happens. AFAIK, no borken paths.
  • cobbal
    cobbal over 11 years
    Unfortunately, you can't use iCloud in apps not from the App Store. (citation)
  • Nico
    Nico over 11 years
    @cobbal: I should at least be able to run the app. Besides which, is there no kind of cert that I could use to test iCloud support in my own app on my own machine?
  • cobbal
    cobbal over 11 years
    @PeterHosey I'm ignorant about that; I've been developing iOS apps for far too long. I suspect the situation on Mac has been borrowed from iOS though, and that you have to have the paid certificate (like the Ad-hoc one that lets you just run apps on iOS devices, but not distribute widely) to be able to use iCloud features. This is pure speculation on my part, and I defer to anyone who actually has tried it.
  • adamdehaven
    adamdehaven over 11 years
    It's actually not the default on Lion
  • Nico
    Nico over 11 years
    It is the default on Lion. Here's a screenshot from a brand-new user account on 10.7.5: i.imgur.com/dyDVN.png
  • adamdehaven
    adamdehaven over 11 years
    Sorry, I was referring to Mountain Lion
  • Marky
    Marky over 11 years
    Thanks, this helped me out.