Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not launch console app with xCode 4.4

Tags:

xcode

I have a project with two targets -- an iOS app and an OSX console app. The latter was created using Xcode File->New Target and selecting "Command Line Tool". This console app is used to prep a default database needed by the iOS app -- using CoreData. This has been working fine until I upgraded to Mountain Lion and xCode 4.4. Now when I try to run the command line tool I get a "Could Not Launch -- permission denied" error. I have tried playing around with signing certificates, to no avail. Interestingly if I create a new "hello, world" command line tool in a new project it works just fine -- and it is not signed at all.

I checked the file and it has -rwxr-xr-x permission. In the debugger the app fails on startup even before it tries to access the moms. If I try to run this outside of the debugger at the command line, it ends with a kill 9 message.

Any ideas would be greatly appreciated.

like image 391
lp1756 Avatar asked Jul 27 '12 19:07

lp1756


3 Answers

I just had the same problem in my iOS/Mac project. None of the above suggestions helped but I managed to find the correct answer so I'm sharing for future ref.

I had to set code signing to Don't codesign for the MacOSX target. The rest works fine no matter if your deployment target is set to default or not. Don't forget to set your Base SDK to Current OSX and supported platforms to "x86_64 i386".

HTH! Cheers

like image 89
Alex Kremer Avatar answered Nov 02 '22 15:11

Alex Kremer


Also you can get "Could Not Launch -- permission denied" error when trying to launch app on device with password which not unlocked at launch time.

like image 4
Artem Shmatkov Avatar answered Nov 02 '22 15:11

Artem Shmatkov


Found the answer. On the Info page I had to change OS X deployment target from Default to 10.8. Default I guess no longer defaults correctly. Anyway it now works.

like image 3
lp1756 Avatar answered Nov 02 '22 16:11

lp1756