Preconditions:
- Have xdebug configured on PHPStorm.
- Installed N98-magerun. Github repository
In command line, run following command first time (with same server name as configured in PHPStorm):
export PHP_IDE_CONFIG="serverName=localhost.tld" export XDEBUG_CONFIG="idekey=PHPSTORM"
Next, run following command from root if magerun is there:
./n98-magerun2.phar sys:cron:run name_of_cron_job
If you are listening for debug connections, it will stop at first breakpoint now.