cordova/phonegap does not make android directory

前端 未结 3 1485
野趣味
野趣味 2020-12-10 06:16

ant, java, node.js, phonegap, and my adobe account are all setup properly. The getting started guide says I should be able to type:

cordova create hello com.e         


        
3条回答
  •  心在旅途
    2020-12-10 07:10

    It does seem like you are using PhoneGap 3.0 and for this version, eclipse is not required (only if you want to use it for coding - compared to PhoneGap 1.0-2.x where eclipse was used to compiled the app, for the latest version it is no longer a requirement).

    1. To begin, you should use the phonegap command instead of the cordova command: phonegap create hello com.example.hello "HelloWorld"

    2. Then navigate to /HelloWorld/ folder

    3. You should see atleast these two key folders /www and /platforms. Inside /www is where you place your HTML files and codes, and /platforms/android gets generated when you compile the app with the following command: phonegap build android.

    Note: Avoid making any direct changes to files inside /platforms except for config and manifest files. The other files are dynamically generated when you run the build command. All coding should take place within /www.

    One more thing, use the 3.0.0 Getting Started guide.

    ---- February 2014 Update ----

    With the release of Cordova 3.3.0, it seems the PhoneGap team is trying to address the naming confusion. The documentations have been updated to recommend people using the cordova command instead. Do not use the phonegap command anymore.

    Here is a fresh installation guide for a guaranteed trouble free set up:

    1. Install Cordova (forget the name PhoneGap from now on). For PC:

      C:> npm install -g cordova

    2. From command prompt, navigate to the folder you want to create your project using:

      cordova create hello com.example.hello HelloWorld
      cd HelloWorld

    3. Define the OS you want to suppport, we'll go with Android for this example:

      cordova platform add android

    4. Install plugins (If needed). For example we want the following:

      cordova plugin add org.apache.cordova.device
      cordova plugin add org.apache.cordova.camera
      cordova plugin add org.apache.cordova.media-capture
      cordova plugin add org.apache.cordova.media
      

    5. Finally, generate the app using:
      cordova build android
      or to directly install the app to your connected device:
      cordova run android

    Here is a link to the PhoneGapCordova 3.3.0 Documentation http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

提交回复
热议问题