Xcode 4.5 doesn't run / load app on simulators or device

旧城冷巷雨未停 提交于 2019-12-04 08:48:38
Ronbo

I had a similar situation happen when I was trying to run my first HelloWorld app for Phone Gap iOS.

It turned out for me the executable was missing from Edit schema dialog. Very odd since it ran fine a few times and then it stopped working until I found this dialog.

You can find this dialog in Product -> Edit Scheme --> Info --> Executable (make sure it is not empty).

Although, you found your solution this is a quick check that may help others.

Vaibhav Saran

before follow please read my edited comments below

  1. Quit XCode
  2. Quit Simulator
  3. go to all the path in the image and delete all these folders

  4. Open simulator and in iOS Simulator menu Reset content and settings. Reset it

Start XCode and you should not worry now.

EDIT

I again got issue few days after the error so I tried the steps above but nothing happened :(, 2nd time i reinstalled the xcode after deleting everything related to xcode and simulator and made a new project. For a clean project application run well but again copying all files from older project in same manner, again faced the same issue. So how i fixed that?

You might still need to follow the steps above, not sure these works or not. But i tried to find that the issue starts at the time when i was copying files from old project.

While adding files to the new project a dialog box appears to ask location of existing files and if you see folders option with 2 radio buttons then by default Create group of any added folder (if needed) is selected. Everything went well until i did not touch these options.

Green: Default, Red: user selected

But problem started appearing again when for a Resources folder I used the 2nd radio button that says, Create folder references for any added folder. When I removed this folder reference and cleaned project, application ran well. Adding same folder with Create group of any added folder (if needed) option worked also well. Whenever I chose 1st radio button, application showed same issue.

and

I believe you understand difference between these 2 options i.e. folder colors to yellow and folder colors to blue! Hope this helps all other people also but it is really frustrating and i request apple to fix this bug ASAP :( :(

So, I'm not sure this is the actual answer, but I seem to have found a procedural sequence that works.

First: I completely deleted Xcode (again), reinstalled it from scratch (again), and updated all the simulators except 4.3 as well as the command line tools (Xcode > Preferences > Download > Components > All simulators except 4.3 & the command line tools) again.

Second: I also reinstalled PhoneGap 2.1, but I'm not sure this was necessary, it was more of a scorched earth campaign. The problem in Xcode seemed to stem from the Scheme, I kept getting Schemes named "CordovaLib" instead of my project names. If you click on "CordovaLib" on the Scheme/Simulator buttons (the top left hand side is where the available schemes & simulartors are listed, right next to the build & stop buttons), and change the scheme to the project name that helps.

Third: You need to make sure that the location for your app is set to "unique". Do this at Xcode > Preferences > Locations > Locations (not Source Trees) > Derived Data > Advanced > Build Location == Unique > Done.

It seems to help to open the projects in Xcode instead of launching them from Finder, but I'm not convinced that's true, it just seemed to work better, but I could be imagining it.

If I do this on projects I used to have problems on, I can now download them to the simulators & my phone.

This didn't get any responses, but maybe someone else will find it useful.

I had to delete the schema and recreate;

  1. Product >> Schema >> Edit Schema.
  2. Then Manage Schemes.
  3. Then hit "-" to delete schema and
  4. Autocreate Schemes Now.

Then, in Simulator, I reset settings. Then it worked.

I resolved the problem by changing the active schema to HelloWorld instead of CordovaLib.

Product->Scheme->HelloWorld - make sure the checkmark is beside this item instead of CordovaLib.

I had to go to Product > Schema > Edit Schema

Then in the Run dialog, the Executable dropdown was on None. I changed it to the .app file and it worked!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!