Copyright (C) 2021, Axis Communications AB, Lund, Sweden. All Rights Reserved.
This README file explains how to build a simple shell script manifest ACAP application.
Together with this README file, you should be able to find a directory called app. That directory contains the "shell-script-example" shell script file which can easily be run with the help of the tools and step by step below.
These instructions will guide you on how to execute the code. Below is the structure and scripts used in the example:
shell-script-example
├── app
│ ├── shell_script_example
│ ├── LICENSE
│ └── manifest.json
├── Dockerfile
└── README.md- app/shell_script_example - Shell script application which writes "Hello World!" to system-log.
- app/LICENSE - Text file which lists all open source licensed source code distributed with the application.
- app/manifest.json - Defines the application and its configuration.
- Dockerfile - Assembles an image containing the ACAP Native SDK and builds the application using it.
- README.md - Step by step instructions on how to run the example.
Below is the step by step instructions on how to execute the program. So basically starting with the generation of the .eap file to running it on a device:
Standing in your working directory run the following commands:
Note
Depending on the network your local build machine is connected to, you may need to add proxy settings for Docker. See Proxy in build time.
docker build --platform=linux/amd64 --tag <APP_IMAGE> .<APP_IMAGE> is the name to tag the image with, e.g., shell_script_example:1.0
Copy the result from the container image to a local directory build:
docker cp $(docker create --platform=linux/amd64 <APP_IMAGE>):/opt/app ./buildThe working dir now contains a build folder with the following files:
shell-script-example
├── app
│ ├── shell_script_example
│ ├── LICENSE
│ └── manifest.json
├── build
│ ├── shell_script_example*
│ ├── shell_script_example_1_0_0_all.eap
│ ├── shell_script_example_1_0_0_LICENSE.txt
│ ├── LICENSE
│ ├── manifest.json
│ ├── package.conf
│ ├── package.conf.orig
│ └── param.conf
├── Dockerfile
└── README.md- build/shell_script_example* - Application shell script file.
- build/shell_script_example_1_0_0_all.eap - Architecture-independent .eap file, compatible with both
armv7hfandaarch64devices. - build/shell_script_example_1_0_0_LICENSE.txt - Copy of LICENSE file.
- build/manifest.json - Defines the application and its configuration.
- build/package.conf - Defines the application and its configuration.
- build/package.conf.orig - Defines the application and its configuration, original file.
- build/param.conf - File containing application parameters.
Note
For detailed information on how to build, install, and run ACAP applications, refer to the official ACAP documentation: Build, install, and run.
Browse to the application page of the Axis device:
http://<AXIS_DEVICE_IP>/index.html#apps-
Click on the tab Apps in the device GUI
-
Enable Allow unsigned apps toggle
-
Click (+ Add app) button to upload the application file
-
Select the newly built application package, depending on architecture:
shell_script_example_1_0_0_all.eap
-
Click Install
-
Run the application by enabling the Start switch
Application log can be found directly at:
http://<AXIS_DEVICE_IP>/axis-cgi/admin/systemlog.cgi?appname=shell_script_example----- Contents of SYSTEM_LOG for 'shell_script_example' -----
14:13:07.412 [ INFO ] shell_script_example[6425]: Hello World!