Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it a good practice to manually change files in platforms?

Tags:

cordova

I have a fresh Cordova project that has 2 platforms, for Windows 8 and Android.

I was wondering if it is a good idea to manually change the files inside platforms/ after they have been generated with cordova build?

like image 985
Calin Avatar asked Nov 18 '25 08:11

Calin


1 Answers

The good practice is to change files in the root of the project and not in the platforms folders.

The idea is to have a common code for all the platforms.

To have html/js specific for a platform you can use the merges folder, and you can also use the hooks for special customisations.

There are some files that still(as of cordova 3.3) need to be modified in platforms folders like icons or splash screen that are not yet taken from the root of the project when building or some config files like AndroidManifest.xml when you need to modify some specific settings.

If you modify files in the www folder of platforms, you must also be aware that each new launch of cordova build or cordova prepare will overwrite your changes with the content of the root www folder (and installing plugins via cordova plugin add requires to prepare or build).

like image 70
QuickFix Avatar answered Nov 21 '25 06:11

QuickFix