1

I have got a job to reform a Cordova iOS project to the newest version. However the only source code I have received is the iOS platform. The folder's structure is like this

-ios (root folder)
--cordova (folder)
--CordovaLib (folder)
--icon
--icon@2x.png
--AppName (folder)
--AppName.xcodeproj
--RandomSDK (folder)
--Versioning.txt
--www(folder)

So as you can imagine, it must be just a sub-folder under the platform folder in a complete Cordova project. And the Cordova version of this iOS project indicated by the file under path .\CodovaLib\VERSION is 2.7.0

My question is, is there any whether "dirty" or "clean" way one can build it up to the newest Cordova platform as well as the newest iOS version? I even don't have to recover the original Cordova project. The only thing need to be cared here is the iOS project.

I have read some of the post like Upgrade Cordova Version of an iOS app (which I called it a "dirty" way). I just want to do something like that, with only www folder, plugin folder and config file in the iOS platform, but that post only tells how to do it with the original Cordova project.

For the "clean" way I mean do something like this: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/upgrade.html .

n4feng
  • 2,226
  • 3
  • 11
  • 17

1 Answers1

0

OK, After some struggles, I finally make it work and compiled. Here are the steps I do in a high level of view.

First, I have created a brand new Helloworld template Cordova project and name the project name and bundle identity exactly same as the old one. Second I copy the www folder to from the old iOS project to the new Cordova project. (Yes, the www folder in both iOS platform and Cordova are the same), and then base on what I need, I change the settings such as content src to the one I want manually. Third I built the iOS platform, then copied all the files that are missing from the old iOS project, use the old xcode project covered the new one, and manually changed all the config files manually to make it consist both to the newest Cordova and the old iOS project. Last I exclude all the old plugin from the xcode project, and remove any old plugin from the project, then reinstall them via the latest Cordova. And miraculously it work!

In general, what I did is mostly like what this post have done, except first you need to set up all the config manually, second after you build up the iOS platform you still have to copy everything and confiure them again since the Cordova project here is no more than a Helloworld template with the html, js and css files you need.

Actually this is my first time maintaining a Cordova project at work. I think the idea is really neat, but somehow it is really hard to make it work due to the hardware support vary from device to device, which is unfortunately. Hopefully later on people can use the design pattern that separate the UI and core of the mobile app so that at least things like Cordova can do the UI work all together.

n4feng
  • 2,226
  • 3
  • 11
  • 17