AEM start script for developers

In many cases, it’s much simpler to use an external script rather that every time navigate into the crx-quickstart folder and manually clean outdated log files and then manually run start script from bin folder.

Below is my start.bat script file content to automate this actions for Windows:

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



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 "$@"

Place this script at the same level as and proceed to enjoy of AEM developing process.