Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova : what is the use of platform_www folder?

Tags:

cordova

Adding a platform in cordova creates files & folders for that platform. This includes a folder named platform_www for ex ios\platform_www, The files in this folder are available in the folder www.

Please explain use of this folder & why its required?

like image 675
Anulal S Avatar asked Nov 06 '15 07:11

Anulal S


People also ask

What does cordova Clean do?

Prevents Android from being installed / removed on platform steps.

What are cordova plugins?

A plugin is a package of injected code that allows the Cordova webview within which the app renders to communicate with the native platform on which it runs. Plugins provide access to device and platform functionality that is ordinarily unavailable to web-based apps.

How do I remove cordova platform?

'cordova platform update /path/to/android/platform --save' => In addition to updating the android platform to version in the folder, update config. xml entry. 'cordova platform remove android --save' => Removes the android platform from the project and deletes its entry from config.


1 Answers

An overview of platform_www

  • Running the command cordova platform add ios creates the platform_www directory under platforms/ios/. This directory contains javascript files, like cordova.js which are added to the mobile app when it's built. At this point the platforms/ios/www directory doesn't exist yet.
  • Every Cordova plugin contains a javascript wrapper that communicates with the native code (iOS swift/objective-c, Android Java/NDK, etc). When running the command cordova plugin add the platform_www directory is updated with a javascript wrapper file pertaining to that plugin. At this point the platforms/ios/www directory doesn't exist yet.
  • Running cordova build ios is equivalent to running cordova prepare ios and then cordova compile ios. The cordova prepare command copies the user's www directory in the root directory, and combines it with platforms\ios\platform_www to create a new directory platforms\ios\www.
  • Running cordova clean removes the platforms\ios\www directory, but leaves the platforms\ios\platform_www directory and the www directory in place, so they can be combined in future builds. Running cordova plugin remove removes the javascript wrapper file for a specific plugin from platforms/ios/platform_www. And running cordova platform remove ios will remove the platforms/ios/platform_www directory.
like image 159
tim-montague Avatar answered Sep 27 '22 20:09

tim-montague