抱歉,该网页目前还不存在中文版本,请继续浏览其他网页!

System setup

This page describes using the new, simpler, NPM-based crosswalk-app-tools to build and debug. The deprecated instructions for make_apk.py are still available.

These steps will enable you to develop Crosswalk applications to run on Android.

Install tools

The following tools are needed on your development system to build Android apps. The same tools are needed on Linux and Windows. Download and install the appropriate version for your platform.

Install the Oracle Java Development Kit (JDK)

Download and install the Oracle JDK: http://www.oracle.com/technetwork/java/javase/downloads/ (Java 7 and 8 are known to work)

Install Apache Ant

Download and install the Apache Ant build tool: http://www.apache.org/dist/ant/binaries/ (Version 1.9.3 is known to work)

Install the Android SDK

  • Download and install Android Studio from http://developer.android.com/sdk/index.html.

  • Start the SDK Manager, from the command-line or inside Android Studio:

    In Windows:

    > "SDK Manager.exe"

    In Linux:

    > android

    or

  • In the SDK Manager window, install the Platform tools, Build tools, and SDK Platform for the version(s) you are interested in:

Install node.js and npm

Download and install node.js for your platform: https://nodejs.org/en/download/. This will also install npm.

Install crosswalk-app-tools

From a cmd shell use npm to install crosswalk-app-tools

> npm install -g crosswalk-app-tools

Note: If you are developing behind a proxy, see this page

Verify your environment

Check that you have installed the tools properly by running these commands:

Example on Windows:

C:\dev>crosswalk-app check android
  + Checking host setup for target android
  + Checking for android... C:\dev\android\sdk\tools\android.bat
  + Checking for ant... C:\dev\apache-ant-1.9.4\bin\ant
  + Checking for java... C:\ProgramData\Oracle\Java\javapath\java.exe
  + Checking for ANDROID_HOME... C:\dev\Android\
  ...

If any items report missing, add the directory to the program binaries in your PATH. Note: Currently the tool reports an ERROR if lzma is not found. You can safely ignore this for now.

ERROR: Checking for lzma... null

Next Steps

Your system is ready for Android development with Crosswalk.