现有Cordova应用程序入门

时间:2018-11-03 03:04:31

标签: android ios cordova

我需要一些有关如何使用现有应用程序开始使用Cordova的指导。我主要是perl / php开发人员,并由另一方为iOS和Android平台构建了Cordova框架应用程序。我已经解压缩了提供的源,这就是根目录的样子:

[webmaster@www mobile-app]$ ls
config.xml  hooks  node_modules  package.json  package-lock.json  platforms  plugins  res  www

www / index.html如下:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1,user-scalable=no, width=device-width, height=device-height, viewport-fit=cover">
    <meta http-equiv="Content-Security-Policy" content="img-src * 'self' data:; default-src * 'self' about: data: file: gap: wss: ws: ; style-src 'self' 'unsafe-inline'; script-src * 'self' 'unsafe-inline' 'unsafe-eval';">

    <!-- compiled css output -->
    <link href="css/ionic.app.css" rel="stylesheet">

    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.min.js"></script>
    <script src="lib/angular-audio/app/angular.audio.js"></script>
    <script src="lib/ngCordova/dist/ng-cordova.min.js"></script>
    <script src="lib/abdmob/x2js/xml2json.min.js"></script>
    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/directives.js"></script>
    <script src="js/filters.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
  </head>
  <body ng-app="starter">
    <!--
      The nav bar that will be updated as we navigate between views.
    -->
    <ion-nav-bar class="bar-stable">
      <ion-nav-back-button>
      </ion-nav-back-button>
    </ion-nav-bar>
    <!--
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
    <ion-nav-view></ion-nav-view>
  </body>
</html>

我已经安装了Cordova 8.1,并且正在此CentOS7服务器上工作,并查看我在Stack Overflow上找到的帖子,这表明我需要创建一个新的Cordova应用程序并复制到www目录中才能开始。这是我应该走的路吗?

感谢任何指导或推荐的阅读内容。

我想了解的一件事是,在安装Cordova并创建一个新的应用程序,然后添加iOS和Android平台之后,我使用cordova platform -ls命令在“已安装平台”下看到了这些platems。但是,此命令在现有应用程序目录中未列出任何已安装平台:

[webmaster@www mobile-app-bsd]$ cordova platform -ls
Installed platforms:

Available platforms:
  android ~7.1.1
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~6.0.0

所以我想知道是否应该按照我发现的另一篇文章中的说明进行操作,并在将www目录复制到新创建的应用程序中后添加这些平台?

0 个答案:

没有答案