Easy:
Make 9 alts.
Run a laptop, pc, android phone all at once and do a gym run on each. Once you done the first 3 switch to the next 3 alts and repeat until all 9 have been done.
Make more then 9 alts if you are burning through the gym runs to fast
Only thing thats a little bit of a pain about this method of farming is you will need 3+ full teams of comp pokemon. Which is very costly to setup