XCode won't set my iPhone as active scheme

2019-08-07 01:08发布

问题:

I only wanted to see how my app behaves on first launch, so I deleted it from my iPhone(iOS 4.3), now XCode would show "iOS device" as the active scheme, and when I manually select my iPhone from the list, I get an error (scrolling from the top of the screen) saying Could not launch “project1” No such file or directory (/Users/portal/Library/Developer/Xcode/DerivedData/project1-cfjhjgezzcapwoadaivpptyywptu/Build/Products/Debug-iphoneos/project1.app/project

What might have happened? I CAN install the app on my iPod (iOS 6) though.

回答1:

Delete your derived data directory for this project, by doing the following steps:

Close the project, but keep Xcode opened. Go to "Organizer" -> Projects. On the left side, select your project and then click the "Delete" button for the derived data.

Once it's gone, open up the project, run a Product -> Clean and try to redeploy.

If the 'delete' button is greyed out, click on the little arrow to the right of the derived directory path (this will open up Finder). Shut down Xcode, and then send that directory to the trash. Restart Xcode, run a Product -> Clean on the project and try to redeploy.