简体   繁体   中英

XCode won't run my application on a device/simulator anymore

I am kind of stuck with my XCode problem. First of all: I have a project that contains 5 different targets. Now something went wrong (I can't remember changing anything related to project settings).

If I want to run any target on device or simulator the build succeeds but then nothing happens. Neither the app is started in simulator nor on a device. So I checked the Scheme (-> "Edit scheme") and I could not select my app in the Executable menu. I think I can remember that the .app file was selected there before (as it is if i create any new project). Does anyone know why I can't select anything there?

What I am curious about, is the fact that choosing "Other" in the Executable menu brings me to my DerivedData directory that indeed contains the *.app file resulting from the build. That leads me to my next problem.

If I select this *.app file explicitly and try to run the app XCode gives me the error " does not have an architecture that can execute." But I checked my settings many times and I am definitly using $(ARCHS_STANDARD) in every target.

I am a little bit lost here ... does anyone has a hint, what could have messed up my project and how to fix it?

Might not work, but I've found a lot of bugs in xcode which simply require quitting it, and reopening.

You could also try clearing out the DerivedData directory. Do a full clean build (hold down option key when selecting clean build).

And lastly, reset the simulator via the menu iOS Simulator > Reset Content and Settings.

I got this when I changed the name of my App on one development machine and then tried to work on it a few months later on another machine. I fixed it by deleting the old scheme and Autocreating the new scheme. The settings are under Product - Scheme - Manage Schemes.

OK I solved the problem by myself. I was on the right track before. I did compare the project.pbxproj file again using FileMerge. I merged all lines related to an *.app file from the working version into my corrupt project file. After that my project was fixed. The *.app files showed up under the "Product" group in XCode and I could run the application on simulator/devices again. It seems that I forgot something while I was merging the files via copy & paste. ;)

Rather than cleaning out the DerivedData directory from Xcode, have you tried the "old fashioned" way from Finder? Try quitting Xcode, nuking ~/Library/Developer/Xcode/DerivedData/ModuleCache from Finder, and restarting Xcode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM