Xcode 4.2 Product -> Run Greyed Out
Asked Answered
P

4

24

My "Run" button under "Product" is greyed out and after trying a few things from various forums, can't figure out what's gone wrong.

I've tried removing the project.xcworkspace and xcuserdata files and letting xcode generate new ones, but no...

My co-worker uses AppCode from IntelliJ and when he pulls the code, it runs just fine. But if he opens the same files in his Xcode, his "Run" is also greyed out.

Polydipsia answered 16/11, 2011 at 1:13 Comment(7)
What is the XCode version are you using? And how long does it stay greyed out. What happens if you use keyboard shortcut Command + RKaveri
XCode 4.2, Command + R does nothing, it's permanently greyed outPolydipsia
What happens when you create a new project and Build + Run ?Kaveri
Other projects build and run just finePolydipsia
Can it do with the schemes? Are you sure you have a scheme that you know is the one you want?Beverly
I had a similar issue with AppCode where I accidentally removed the product group and its content. It still worked in AppCode, but not in Xcode. The scheme and target settings were correct, but the "Run" menu item was grayed out and pressing the run triangle icon caused the code to compile, but nothing happened afterwards. Duplicating the app target and recreating a scheme for it fixed the problem.Allomorphism
@LukasKubanek if only I had seen your comment a few hours ago :( duplicating target solved my problem. thanks.Natie
P
4

My co-worker who uses AppCode had edited the configuration file, moved some frameworks around, etc... We noticed that there was a difference between XCode and AppCode in using relative vs. absolute paths in the project.pbxproj file.

Ultimately I just reverted the code to before his changes, so at this stage, I'm not entirely sure which difference in the config file actually caused Xcode to not be able to Run the project.

**EDIT From the .git logs, it looks like AppCode was adding relative directories with 7 sets of "/../" and before there were only ever instances of 5 "/../" to get back to the root directory. Rather frustrating that Xcode had no way of dealing with this from inside the IDE.

Polydipsia answered 16/11, 2011 at 18:28 Comment(1)
same thing in 2015. somehow the scheme got corrupted and the executable ipa was unselectable in xcode. opening the project in AppCode and changing the executable for the scheme solved the problem.Natie
O
34

"Edit" your current "Scheme":

enter image description here

Make sure you have "Run" checked for that build target:

enter image description here

Overanxious answered 16/11, 2011 at 18:40 Comment(3)
The Scheme is fine, there was a difference between the relative directory structures that AppCode was editing pbxproj with and Xcode.Polydipsia
@Polydipsia Ah, ok. Glad you got it fixed!Overanxious
And changing "Executable" from none to XXX.app fixed my case.Rundown
P
17

The scheme need to be fixed (I don't know why xcode changed it)
Here are the required steps:
Goto project, Edit Scheme..., Change executable

Patiencepatient answered 2/1, 2016 at 17:56 Comment(1)
worked for me! Thanks! This happened after I copied the product. It didn't set the schema automatically.Chayachayote
B
5

Make sure you have the correct target selected.

(Upper-left in Xcode window, near the triangular Run button.)

Beesley answered 28/8, 2013 at 18:49 Comment(0)
P
4

My co-worker who uses AppCode had edited the configuration file, moved some frameworks around, etc... We noticed that there was a difference between XCode and AppCode in using relative vs. absolute paths in the project.pbxproj file.

Ultimately I just reverted the code to before his changes, so at this stage, I'm not entirely sure which difference in the config file actually caused Xcode to not be able to Run the project.

**EDIT From the .git logs, it looks like AppCode was adding relative directories with 7 sets of "/../" and before there were only ever instances of 5 "/../" to get back to the root directory. Rather frustrating that Xcode had no way of dealing with this from inside the IDE.

Polydipsia answered 16/11, 2011 at 18:28 Comment(1)
same thing in 2015. somehow the scheme got corrupted and the executable ipa was unselectable in xcode. opening the project in AppCode and changing the executable for the scheme solved the problem.Natie

© 2022 - 2024 — McMap. All rights reserved.