How to run a Adobe AIR application on a headless server
The problem is not that you are trying to run it from a terminal. The problem is that there is no graphical display running on the machine. You seem to be running on a headless server.
I'm aware of two possibilities:
- If you connect with ssh, you can add the
-X
option and allow the Adobe AIR application to use your local display
- You can fool Adobe AIR into believing that there is a display running by installing xvfb. Use the script bellow which I've copied from this post:
Copy this code into a file named xvfb_wrapper.sh
:
#!/bin/sh
#
# Author: Matthew Wilson, rPath, Inc.
#
# This could probably be done more elegantly in Python...
pid=''
for ((d=0; d < 20; d++)); do
DISPLAY=:$d
Xvfb -ac $DISPLAY > /dev/null 2>&1 &
sleep 2
jobs -l %1 > /dev/null
pid=$(jobs -l %1 2>&1 | grep Running | awk '{print $2}')
if [ -z "$pid" ]; then
continue
fi
if ps $pid > /dev/null 2>&1; then
break
fi
done
if [ -z "$pid" ]; then
echo "unable to start Xvfb"
exit 1
fi
trap "kill -9 $pid" SIGINT SIGTERM EXIT
export DISPLAY=$DISPLAY
$*
Call chmod +x xvfb_wrapper.sh
to give it execution rights. Call your application with the xvfb_wrapper.sh in front of it. In this example this would be:
sudo xfvb_wrapper.sh "Adobe AIR Application Installer" -silent -eulaAccepted MyAirApp.air
Edit: Added information from comments and the script from link.