Printf - like debugging in URCaps or any alternative?

If you are running in the simulator, using System.out.println("Some debug string"); will print a line in the terminal, this is the simplest way of debugging your URCap code itself.

For the URScript debugging check out the debugging suggestions in this forum including what was suggested by @hch