on the fly
informal If you do something on the fly, you do it quickly, often while you are doing something else, without preparing and without thinking too much about how it should be done:
This new rule seems to have been created on the fly.
specialized computing without interrupting a computer program that is already running:
He had written a program that could translate from Japanese on the fly.