Testing for 5000 devices isn't much different from testing for 8 devices. At some point you stop writing and testing for every configuration separately, and start grouping them, pretty much as you describe with one code and 3-5 sets of assets (counting both bitmaps and layouts).