AEM Start Script for Developers

Evgeniy Fitsner Software Engineer
2 min read
AEM Start Script for Developers

Navigating to the crx-quickstart folder to clean logs and restart AEM instances every time is tedious. Below are automation scripts for both Windows and macOS.

Place either script at the same directory level as license.properties.

Windows (start.bat)

1
2
3
4
5
6
7
8
del /s /q ".\crx-quickstart\logs\*.*"

set CQ_PORT=4502
set CQ_RUNMODE=author,localdev
set CQ_JVM_OPTS=-Xmx2048m -XX:+UseG1GC -XX:-UseGCOverheadLimit -Duser.language=en -Duser.region=US -Duser.timezone=UTC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001

cd ./crx-quickstart/bin
call ./start.bat

macOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

echo "Clean AEM logs"
find crx-quickstart/logs/ -type f -delete

echo "Set AEM parameters"
export CQ_PORT="4502"
export CQ_DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"
export CQ_LOCALE_OPTS="-Duser.language=en -Duser.region=US -Duser.timezone=UTC -Dfile.encoding=UTF-8"
export CQ_RUNMODE="author,nosamplecontent"
export CQ_JVM_OPTS="-Djava.awt.headless=true -Xmx2048m -XX:+UseG1GC -XX:-UseGCOverheadLimit $CQ_LOCALE_OPTS $CQ_DEBUG_OPTS"

echo "Start AEM instance"
crx-quickstart/bin/start "$@"