Github的Cordova项目 [英] Cordova Project from Github

查看:90
本文介绍了Github的Cordova项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从github克隆cordova应用程序源代码.如何安装cordova并为其添加android平台并在Android Studio中进行构建? 克隆代码后,我正在安装cordova,但无法添加平台或与cordova相关的任何内容.是否有关于如何遵循正确步骤使其在Android Studio中运行的教程?我是科尔多瓦的新手.谢谢!

I m cloning a cordova app sourcecode from github. How do I install cordova and add android platform to it and build it in Android Studio? After cloning the code, I am installing cordova, but cant add platform or anything related to cordova. Is there any tutorial on how to follow the correct steps to make it run in Android Studio? I am very new to Cordova. Thanks!

推荐答案

首先:请遵循GitHub存储库的自述文件并查找安装说明.

First of all: follow the GitHub repo's README and look for installation instructions.

要使用cordova应用程序,您绝对需要科尔多瓦CLI.如果尚未安装,请从 http://nodejs.org 安装NodeJS和npm或使用您选择的软件包管理器.然后在终端运行

To play around with a cordova app, you most definitely need the cordova CLI. If you haven't already, install NodeJS and npm from http://nodejs.org or using your package manager of choice. Then inside a terminal run

npm install -g cordova

(如果您使用的是Linux,则可能必须使用sudo运行该命令)

(If you are using Linux you probably have to run that command with sudo)

现在,您进入克隆的github存储库并运行

Now you navigate into the cloned github repo and run

cordova platform add android
cordova build android

它将在./platforms/android下创建一个目录,您可以使用Android Studio打开该目录.然后,您可以在模拟器或连接的设备上运行该应用程序.

It will create a directory under ./platforms/android which you can open using Android Studio. Then you can run the app with an emulator or a connected device.

如果您在任何时候收到错误消息或认为缺少某些内容,则可以运行(在GitHub克隆存储库中)

If at any point you receive error messages or you think something is missing, you can run (inside the GitHub cloned repo)

cordova requirements

它将显示科尔多瓦CLI是否缺少某些内容.您将必须修复所有出现的错误.请参阅 https://下的cordova文档. cordova.apache.org/docs/en/latest/guide/cli/#installing-the-cordova-cli 为此.

It will show you if the cordova CLI is missing something. You will have to fix all the errors that come up. Consult the cordova documentation under https://cordova.apache.org/docs/en/latest/guide/cli/#installing-the-cordova-cli in order to do that.

希望这会有所帮助.

这篇关于Github的Cordova项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆