0

Your help would be really appreciated. Error: I’m not able to run my iOS app in Xcode simulator while the project builds. The option to run the app (from Menu bar -> Product -> Run) is grayed out. What I tried to fix it:

  1. Restarted Xcode and my Mac
  2. Cleaned build folder
  3. Created a brand new project and the app of the new project runs in the simulator
  4. Checked the scheme settings. However, the "executable" drop down menu doesn't show my app. (as shown in the screenshot below). If I choose "Other" from the drop down, the app isn't there in the other list either. Executable not showing my app

Environment & project info Environment: macOS 13.2.1 + Xcode 14.2 Project target iOS: 15.5 External packages: Firebase (Auth), Facebook & Google (all via Swift Package Manager)

Please help and let me know if more info is needed.

Expecting that:

  1. The app runs in the simulator when I hit cmd + R
  2. The app show up as the executable in scheme settings.

Screenshot of xcodeproj file

  • Have you removed the app target from the project? When you select the project/workspace file in Xcode, do you see the app target in the "Targets" list? If no, then you removed the target. Below the targets list there are + and - symbols. There your can press +, scroll down to the iOS section and select "App". That adds a new executable iOS app target to the project that you can then select in your scheme to run. – JanMensch Mar 07 '23 at 13:14
  • Hi, thanks for your reply! I don't think I removed the app target. Just to make sure, could you check the screenshot I added at the end of the question post, is that part what you're referring to? – user20297042 Mar 07 '23 at 13:40
  • Yes that would be the app target and it should show up in the "executable" dropdown in the scheme settings. Have you been able to run the app before on this project? If so, then something must have happened that broke a configuration. – JanMensch Mar 07 '23 at 13:52
  • Yes I was able to run it before. My guess is that the xcodeproj file was broken while resolving conflicts for a git merging. But I’m not sure. – user20297042 Mar 07 '23 at 14:24
  • 1
    Still dont know why but the following steps made it work: 1. Menubar->File->Project setting->Arrow button to go to the derived data folder in Finder; 2. Delete the derived data folder for this app; 3. Menu bar ->Product->Scheme->Manage Scheme; 4. Delete all schemes, tap "Autocreate schemes now"; 5. Refetche 3-rd parties libs; 6. cmd + B to build (without running); 7. go to manage scheme again (same as step 3); 8. select "Run" and in the executable drop down, select Other and manually select the .app file (which wasn't there in the previous derived data folder). Thanks JanBrinker for your help! – user20297042 Mar 07 '23 at 14:56
  • Glad to help :) Maybe you could also go back in git history to actually see the commit that broke things and reconstruct what happened to prevent this coming up again. But for now: glad that it works now :) – JanMensch Mar 07 '23 at 16:11
  • yeah definitely will check git history – user20297042 Mar 07 '23 at 16:40

0 Answers0