Running Apps

Running an app on ActyxOS requires you to deploy the app, configure the app and start the app. Let's run through an example.

Deploy the app

If you followed the previous guide, Building Apps, you should be in the directory called my-app. In this directory you should have a file called com.example.myapp-1.0.0.tar.gz that contains your packaged ActyxOS app.

To deploy the app use the Actyx CLI as follows:

ax apps deploy com.example.myapp-1.0.0.tar.gz --local localhost
Use the device IP for remote nodes

In the above example we assumed you are running ActyxOS locally. To deploy to a remote node, simple replace localhost with the node's IP address.

Start the app

If you run ax apps ls --local localhost now you should see the following:

+-----------+-------------------+---------+----------+---------+----------+---------+---------+
| NODE ID | APP ID | VERSION | ENABLED | STATE | SETTINGS | LICENSE | STARTED |
+-----------+-------------------+---------+----------+---------+----------+---------+---------+
| localhost | com.example.myapp | 1.0.0 | DISABLED | STOPPED | VALID | VALID | |
+-----------+-------------------+---------+----------+---------+----------+---------+---------+

What this is telling you is that your app is currently not enabled, stopped and has valid settings. In order to get the app into a running state, you need to start it as follows:

ax apps start com.example.myapp --local localhost

Running ax apps ls --local localhost again you should now see that the app has been started and is running (STATE):

+-----------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+
| NODE ID | APP ID | VERSION | ENABLED | STATE | SETTINGS | LICENSE | STARTED |
+-----------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+
| localhost | com.example.myapp | 1.0.0 | ENABLED | RUNNING | VALID | VALID | 2020-04-06T13:54:45.003324400+00:00 |
+-----------+-------------------+---------+---------+---------+----------+---------+-------------------------------------+

Access app logs

If you want to access the logs being generated by ActyxOS and your app, simply use the following Actyx CLI command:

ax logs tail --follow --local localhost

Stop the app

To stop the app run the following Actyx CLI command:

ax apps stop com.example.myapp --local localhost