Arduino Sketch Not Running While Battery Powered

This is just a guess, as I didn’t test it… but maybe it’s getting stuck here?

while (!Serial);

EDIT: verified. The program is waiting for the USB serial port to be connected.