I have just donwloaded Apache Cordova and it seems like there are platform specific versions. Do I have to code for a specific platform before porting it to another? Is it possi
Answer by @MBillau perfectly describes the concept, from source code perspective there are some specific CLI-related commands:
cordova create com.domain.projectname
- create a project.
cordova platform add ios
or cordova platform add android
- add target platform, after creating a project remember to cd com.domain.projectname
, otherwise you might see something like that Current working directory is not a Cordova-based project.
in your terminal.
cordova plugin add pluginname
- add specific plugin to the project, which you will need quite often to do. In your terminal you should have something like Installing "pluginname" for ios
and Adding pluginname to package.json
.
Finally cordova build
or cordova build ios
or cordova build android
to build this and cordova emulate android
or cordova run android
to run it on your device or emulate on Android. For iOS you'll need Xcode.
More information you can find on https://cordova.apache.org/docs/en/latest/