Upgrade Phonegap for iOS (from 1.4.1 to latest)

对着背影说爱祢 提交于 2019-12-08 13:20:34

问题


I would like to know if anyone has experience in upgrading phonegap. Would like to get some help.

I have an iOS Phonegap-based project that uses phonegap 1.4.1. I need to update it to the latest version. The latest version is currently 2.2.0

The steps that described in the phone gap document only tells us how to upgrade from one version to the other, but it doesn't help me in upgrade phone gap from a very old version to the latest one.

http://docs.phonegap.com/en/2.2.0/guide_upgrading_ios_index.md.html#Upgrading%20Cordova%20iOS

I can see three BIG changes from 1.4.1 to the latest version.

  1. From 1.4.1 to 1.5.0, PhoneGap.framework has been renamed to Cordova.framework

  2. From 1.9.0 to 2.0.0, Cordova.framework has been removed, instead it uses CordovaLib as a sub-project.

  3. From 2.0.0 to 2.1.0, Automatic Reference Counting (ARC) is introduced to CordovaLib

I am not sure what is the best approach for me to upgrade my old phonegap, I don't feel confident to jump straight from 1.4.1 to 2.2.0, by given the fact that there is no documents/tutorials to follow.

I am thinking to upgrade the phonegap from 1.4.1 to 1.9 first, and then upgrade 1.9.0 to 2.0.0 and to 2.2.0. But it seems a big job.

Please give me some suggestion on it, or is there anyone come across this?

Thanks in advance.


回答1:


My recommendation is:

  1. Create a totally new project.
  2. Copy your www assets into the new www
  3. Refer to the new cordova .js file in your index.html
  4. Re-add your Plugins (make sure the plugins support the new Cordova version)
  5. Update your Cordova.plist settings to reflect what you want, see the Project Settings on http://docs.cordova.io
  6. Update your whitelist, see the Whitelist Guide on http://docs.cordova.io



回答2:


It's really depends on how much your app hooks into the phonegap's "native" calls,..

If it's mostly your own codes, I'd just start a new project and copy the html folder over, find and replace the mentions phonegap.js to cordova.js. Chances are, the app will work, if it doesn't, it should be a minor fix.

Or check out https://build.phonegap.com/ - phonegap's cloud base builder.



来源:https://stackoverflow.com/questions/13266259/upgrade-phonegap-for-ios-from-1-4-1-to-latest

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