3

When you create a fresh Cordova project it's called HelloCordova, which is also the app icon name. If I rename the project in XCode it will no longer run in the iPad simulator.

I am running Cordova 3 and Xcode 4.6.3 on OS X 10.8.4

Steps to reproduce

In terminal:

  • cordova create Survey com.domain.mysurveyap
  • cd Survey
  • cordova platform add ios
  • cordova build

This creates the XCode project in platforms/ios/. I then open it in XCode. The project is called HelloCordova. I hit run with the target set to iPad 6.0 Simulator.

Running HelloCordova on iPad 6.0 Simulator. No issues

Good. I get the Hello World app up.


Next I rename the project by changing the Project Name in the Identity panel. I'm doing this

  • a) because I don't want my project to be called 'HelloCordova'.

  • b) because the name here seems to dictate what the App Icon is labelled as on the device.

I rename it to 'Survey':

enter image description here

Xcode prompts me to rename related project content items for me. I click 'Rename'

enter image description here

After renaming, I go to run in the simulator again. Now it won't run. I see a 'Build succeeded' overlay for a moment. But in the status panel at the top it says:

Finished running Survey.app on iPad 6.0 Simulator. No issues.

enter image description here

I notice that it still shows 'HelloCordova' in the scheme selector. I have tried running 'Clean' and also restarting XCode.

This is a completely fresh PhoneGap project with no modifications. Any ideas where I'm going wrong?

Ade
  • 2,961
  • 4
  • 30
  • 47
  • Have a look [here](http://stackoverflow.com/questions/14385542/project-crashes-after-rename?rq=1) – geekchic Aug 16 '13 at 09:54
  • @nikhitadkslfslg Thanks, sadly no luck. Weirdly, within `platforms/ios` my project is called `Survey.xcodeproj` but the adjacent folder is still called `HelloCordova`. – Ade Aug 16 '13 at 10:06
  • That is weird. I'm not sure either – geekchic Aug 16 '13 at 10:10

1 Answers1

3

I don't know why the renaming was failing, and I can't explain that "Finished running... No issues" problem. But: cordova create takes an extra argument that was missing.

This solves the problem:

cordova create Survey com.domain.mysurveyap "Survey"

The final "Survey" there sets the project name on creation, thus avoiding the need to rename the project in the first place.

Ade
  • 2,961
  • 4
  • 30
  • 47