From IT Skills
Jump to: navigation, search

Cordova CLI[edit | edit source]

versions[edit | edit source]

New versions often include bug fixes and other improvements. However, they can also cause problems for plugins and the version of Node.js that you have installed on your computer or Mac... If you update your CLI, it's tied to a newer version of each Cordova platform while your plugins remain tied to a previous version of each Cordova platform.

platform versions[edit | edit source]

ios 4.0.0[edit | edit source]

cordova v4.0.0 was updated to use minimum deployment target iOS versions#8

upgrade[edit | edit source]

  • Upgrading to new version: cordova platform update android@5.0.0

installation[edit | edit source]

  • npm install -g cordova
  • android needs gradle

initial preparing[edit | edit source]

  • cordova platform add <platform>
  • cordova prepare

removes www folders, helpful for setting icons, launch screens etc

must be done after significant config.xml modifications like name change

In case of conflicts, package.json is given precedence over config.xml

check[edit | edit source]

  • deployment target, device orientation, requires full screen
  • follow xcode recommendations

build[edit | edit source]

  • cordova build (run as administrator)

emulate android[edit | edit source]

configure AVD by Android Studio, sdk already has some system-image but it is hard to configure avd manually

  • cordova run android --emulator

2) Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX 3) Develop on a Linux computer that supports VT-x or SVM

  • APK Installer application to run apk-files

Directory structure[edit | edit source]

Visual studio will remove the platform folder and any file inside of it when you build your project.

to refresh platforms after sources modification manually modify sources in folders like

  • platforms\android\platform_www

Generating binary[edit | edit source]

Android[edit | edit source]

Use ubuntu or PhoneGap#build

build process[edit | edit source]

  • change index.html to have
<script src="cordova.js"></script>
  • "cordova build --release" in /home/e/www
  • apk will show up in /home/e/platforms/android/ant-build

signing key[edit | edit source]

  1. Generate a keystore file
    1. keytool -genkey -v -keystore my-release-key.keystore -alias ALIAS -keyalg RSA -keysize 2048 -validity 10000
  2. Run "jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore file.keystore CordovaApp-release-unsigned.apk ALIAS"
  3. Zip align it "zipalign -v 4 CordovaApp-release-unsigned.apk result.apk"

What js 'engine' does cordova use?[edit | edit source]

On Android it uses Android WebView which is based on Chromium, and uses the V8 JavaScript engine. On iOS, as of iOS8 it uses the WKWebView which is based on Safari and uses the Nitro JavaScript engine.