Natural biopolymers can be controllably in situ synthesized in organisms and play important roles in biological activities. Inspired by this, the manipulation of in situ biosynthesis of functional polymers in vivo will be an important way to obtain materials for meeting biological requirements. Herein, in situ biosynthesis of functional conjugated polymer at the tumor site was achieved via the utilization of specific tumor microenvironment (TME) characteristics for the first time. Specially, a water-soluble aniline dimer derivative (N-(3-sulfopropyl) p-aminodiphenylamine, SPA) was artfully in situ polymerized into polySPA (PSPA) nanoparticles at the tumor site, which was activated via the catalysis of hydrogen peroxide (H2O2) overexpressed in TME to produce hydroxyl radical (•OH) by coinjected horseradish peroxidase (HRP). Benefiting from outstanding near-infrared (NIR)-II absorption of PSPA, the in situ polymerization process can be validly monitored by photoacoustic (PA) signal at the NIR-II region. Meanwhile, in situ polymerization would induce the size of polymeric materials from small to large, improving the distribution and retention of PSPA at the tumor site. On the combination of NIR-II absorption of PSPA and the size variation induced by polymerization, such polymerization can be applied for tumor-specific NIR-II light mediated PA image and photothermal inhibition of tumors, enhancing the precision and efficacy of tumor phototheranostics. Therefore, the present work opens the way to manipulate TME-activated in situ biosynthesis of functional conjugated polymer at the tumor site for overcoming formidable challenges in tumor theranostics.