Do it while it's off, although if you go back to autozone most code readers should be able to erase codes if you ask them to. This has the benefit of not resetting your fuel trims if you care about that. Also, ask around for a good mechanic shop that has a smoke tester, it pumps smoke through...