Compile XeLaTeX tex file with latexmk
latexmk -v Latexmk, John Collins, 16 January 2010. Version 4.13a I put $pdflatex = ‘xelatex –shell-escape %O %S’; in my .latexmkrc file. This is a workaround, of course. But it works for me when I call latexmk -pvc -pdf MyXetexFile