Updated on 2024-11-21 GMT+08:00

Building Android App with Ionic

In this action, you build an Ionic Android app, which is a mobile app that works across multiple platforms. This action allows you to quickly develop mobile apps, mobile web pages, hybrid apps, and web pages.

The project contains the project compilation description files such as ionic.config.json, package.json, and angular.json.

Build on GUI

Add Build Android App with Ionic, when configuring build actions. Set the parameters according to Table 1.
Table 1 Parameters for building an Android app with Ionic

Parameter

Description

Action Name

Assign a custom name to the build action. The name can contain:

  • Letters, digits, hyphens (-), underscores (_), commas (,), semicolons (;), colons (:), periods (.), slashes (/), and parentheses.
  • 1 to 128 characters.

Gradle

Select a Gradle version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

JDK

Select a JDK version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

NDK

Select an NDK version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

Commands

Configure the packaging script in the command box. For more commands, see the Ionic official website.

Build with Code

Modify the code in the BUILD block in Creating a YAML File for Your Code-based Build by referring to the following sample code:

1
2
3
4
5
6
7
8
9
version: 2.0 # The value must be 2.0.
steps:
  BUILD:
    - ionic_android_app:
       inputs:
          gradle: '4.8'
          jdk: '33'
          ndk: '17'
          command: ./instrumented.apk
Table 2 Parameters in the sample code

Parameter

Type

Description

gradle

String

Select a Gradle version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

jdk

String

Select a JDK version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

ndk

String

Select an NDK version that matches your current development environment.

For tool versions supported by CodeArts Build, see build tools and versions. If the current tools and versions do not meet your requirements, you can customize a build environment.

command

String

Configure the packaging script in the command box. For more commands, see the Ionic official website.