The immune phenotype of a tumour is a key predictor of its response to immunotherapy1–4. Patients who respond to checkpoint blockade generally present with immune-inflamed5–7tumours that are highly infiltrated by T cells. However, not all inflamed tumours respond to therapy, and even lower response rates occur among tumours that lack T cells (immune desert) or that spatially exclude T cells to the periphery of the tumour lesion (immune excluded)8. Despite the importance of these tumour immune phenotypes in patients, little is known about their development, heterogeneity or dynamics owing to the technical difficulty of tracking these features in situ. Here we introduce skin tumour array by microporation (STAMP)—a preclinical approach that combines high-throughput time-lapse imaging with next-generation sequencing of tumour arrays. Using STAMP, we followed the development of thousands of arrayed tumours in vivo to show that tumour immune phenotypes and outcomes vary between adjacent tumours and are controlled by local factors within the tumour microenvironment. Particularly, the recruitment of T cells by fibroblasts and monocytes into the tumour core was supportive of T cell cytotoxic activity and tumour rejection. Tumour immune phenotypes were dynamic over time and an early conversion to an immune-inflamed phenotype was predictive of spontaneous or therapy-induced tumour rejection. Thus, STAMP captures the dynamic relationships of the spatial, cellular and molecular components of tumour rejection and has the potential to translate therapeutic concepts into successful clinical strategies.