在离子框架中设置Android Home路径 [英] Setting Android Home path in ionic framework

查看:642
本文介绍了在离子框架中设置Android Home路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android设备中运行我的离子项目。所以我运行了以下命令

I want to run my ionic project in android device.So I ran following commands


  1. Ionic add ionic-platform-web-client

  2. 离子插件添加phonegap-plugin push

  3. ionic io init

  4. ionic platform add android

  1. Ionic add ionic-platform-web-client
  2. ionic plugin add phonegap-plugin push
  3. ionic io init
  4. ionic platform add android

所有上述命令都已成功执行。我试图运行以下命令

All the above commands were successfully executed.We I tried to run following command

 ionic run android 

我给出了错误'ANDROID_HOME'环境变量设置为不存在的路径。尝试手动更新以指向有效的SDK目录。您可能没有运行此项目所需的环境或操作系统。

I gives me error 'ANDROID_HOME' environment variable is set to non-existent path.Try update it manually to point to valid SDK directory.You may not have the required environment or OS to run this project.

如何操作我现在修好了吗?

How do i fix it now?

推荐答案

设置Android开发环境

在构建Android应用程序之前,必须安装Android SDK。安装Android SDK还会安装AVD Manager,这是一个用于创建和管理Android虚拟设备(AVD)的图形用户界面。

Before you can build Android applications, you must install the Android SDK. Installing the Android SDK also installs the AVD Manager, a graphical user interface for creating and managing Android Virtual Devices (AVDs).

来自 Android网站,为您的操作系统下载正确版本的 Android SDK

From the Android web site, download the correct version of the Android SDK for your operating system.

将存档解压缩到您选择的位置。例如,在Linux或Mac上,您可以将其放在用户目录的根目录中。有关其他安装详细信息,请访问Android开发者网站。

Unzip the archive to a location of your choosing. For example, on Linux or Mac, you can place it in the root of your user directory. See the Android Developers web site for additional installation details.

根据Android SDK的位置配置 ANDROID_HOME 环境变量。此外,请考虑将 ANDROID_HOME / tools ANDROID_HOME / platform-tools 添加到您的路径中。

Configure the ANDROID_HOME environment variable based on the location of the Android SDK. Additionally, consider adding ANDROID_HOME/tools, and ANDROID_HOME/platform-tools to your PATH.

Windows
设置ANDROID_HOME = C:\\\\roid-sdk-windows
设置PATH =%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\ platform-tools

要运行本指南中的代码,您需要下载并安装最新的SDK平台。您可以使用上一节中安装的Android SDK和AVD Manager来完成此操作。

To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.


  1. 打开Android SDK Manager窗口

  1. Open the Android SDK Manager window

选择工具复选框。

选中最新Android SDK的复选框。

Select the checkbox for the latest Android SDK.

从Extras文件夹中,选择Android支持库的复选框。

From the Extras folder, select the checkbox for the Android Support Library.

单击安装包...按钮以完成下载和安装。

Click the Install packages…​ button to complete the download and installation.

如果您没有安装Android设备测试时,您可以使用Android虚拟设备。要执行此操作,您必须先安装Android SDK并安装相应的SDK平台和软件包。请参阅设置Android开发环境。

If you do not have an Android device for testing, you can use an Android virtual device.To do this, you must first install the Android SDK and install the corresponding SDK platforms and packages. See Set up the Android development environment.

此命令创建一个名为Default的新AVD,它基于Android 5.1,API Level 22:

This command creates a new AVD named "Default" that is based on Android 5.1, API Level 22:

android create avd --name Default --target android-22 --abi armeabi-v7a

这篇关于在离子框架中设置Android Home路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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