Beginning with Apache Cordova

前端 未结 3 1514
南旧
南旧 2021-02-09 10:55

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

3条回答
  •  情深已故
    2021-02-09 11:34

    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/

提交回复
热议问题