open terminal and run command
$ cd /Library/LaunchDaemons
$ sudo nano apachefriends.xampp.apache.start.plist
and insert
save with ctrl + o and exit with ctrl + x<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$<plist version="1.0"><dict><key>EnableTransactions</key><true/><key>Label</key><string>apachefriends.xampp.apache.start</string><key>ProgramArguments</key><array><string>/Applications/XAMPP/xamppfiles/xampp</string><string>startapache</string></array><key>RunAtLoad</key><true/><key>WorkingDirectory</key><string>/Applications/XAMPP/xamppfiles</string><key>KeepAlive</key><false/><key>AbandonProcessGroup</key><true/></dict></plist>
and now run command on terminal
$ sudo nano apachefriends.xampp.mysql.start.plist
and paste this
save with ctrl + o and exit with ctrl + x<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$<plist version="1.0"><dict><key>EnableTransactions</key><true/><key>Label</key><string>apachefriends.xampp.mysql.start</string><key>ProgramArguments</key><array><string>/Applications/XAMPP/xamppfiles/xampp</string><string>startmysql</string></array><key>RunAtLoad</key><true/><key>WorkingDirectory</key><string>/Applications/XAMPP/xamppfiles</string><key>KeepAlive</key><false/><key>AbandonProcessGroup</key><true/></dict></plist>
and reboot your osx apache and mysql service on your xampp will start automatically.