Deploy Hello World App

Requierements for deploy

Make sure you have the prerequisites to deploy

Maven Deploy

Pom File

In the pom file, we need to add the properties tags and the build tag as shown in the example below.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.totalcross.sample</groupId>
<artifactId>HelloTC</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<totalcross.activation_key>PLACE_YOUR_KEY_HERE</totalcross.activation_key>
</properties>
<dependencies>
<dependency>
<groupId>com.totalcross</groupId>
<artifactId>totalcross-sdk</artifactId>
<version>5.0.1</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>totalcross-repo</id>
<name>ip-172-31-40-140-releases</name>
<url>http://maven.totalcross.com/artifactory/repo1</url>
</repository>
</repositories>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.orfjackal.retrolambda</groupId>
<artifactId>retrolambda-maven-plugin</artifactId>
<version>2.5.1</version>
<executions>
<execution>
<goals>
<goal>process-main</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>tc.Deploy</mainClass>
<arguments>
<argument>${project.build.directory}/${project.build.finalName}.${project.packaging}</argument>
<argument>-win32</argument>
<argument>-android</argument>
<argument>-ios</argument>
<argument>/p</argument>
<argument>/r</argument>
<argument>${totalcross.activation_key}</argument>
<argument>/m</argument>
<argument>{put ios certificate path here}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

If you do not have a license for IOS you should remove line 70, 74 and 75

Intellij Idea

To build the project, you can go to the run menu, and click in edit configurations.

Click in plus button and select Maven.

In Command Line, add comand "clean package"

Clean: Erase the target folder

package: Will build the application according to the arguments you put in the pom

After create Maven Build you can run the HelloTC[clean,package] for build your app.

Just click in run button

Eclipse

To build your app you can right click on the project and select Run as -> Maven Build.

Add these arguments in the Goals field: clean package. After this just click in Run;

Clean: Erase the target folder

package: Will build the application according to the arguments you put in the pom

After insert in Goals field, just click in Run for build your apps.

Your apps

After build your apk It is inside the folder target\install\ of your project. Sample: Location_of_your_project\HelloTC\target\install\