You can debug code running in Common intermediate language (CIL) with Visual Studio.
Open Visual Studio. In Debug click Attach to Process. Select Ax32Serv.exe and click Attach.
In Visual Studio, use the Application Explorer to open your batch class. Set a breakpoint in the run method.
Alternatively, also in Visual Studio, open your batch file located in C:\Program Files\Microsoft Dynamics AX\60\Server\AX2012_DEV\bin\XppIL\source. Set a breakpoint in the run method.
Open an AX client. Add your batch job in System administration, Inquiries, Batch jobs, Batch jobs.
When the system execute your batch job, the debugger should come up at the breakpoint setted in the run method.
Note that if you make some X++ changes in your batch class during your debugging session, Visual Studio need to see those changes. Compiling the class is not enough.
Start with a Generate Incremental CIL. If your changes appear in Visual Studio, you can continue. Otherwise, do a Generate Full CIL before resuming your debugging session.