Black soldier fly larvae (Hermetia illucens) (BSFL) are insect larvae with significant ecological and economic value. This study aims to investigate whether swill and manure had any effects on the transcriptome and metabolome of BSFL. Through high-throughput transcriptome sequencing, we found that larvae fed with swill exhibited higher levels of gene expression, especially with the upregulation of genes related to energy metabolism, amino acid metabolism, and redox reactions. Metabolomics analysis showed a significant increase in energy metabolism-related metabolites, such as organic acids and amino acids, in the swill-fed larvae. In contrast, gene expression and metabolic characteristics in the pig manure-fed group indicated a higher stress response, with relevant genes and metabolites (such as short-chain fatty acids and antioxidants) showing significant upregulation. GO and KEGG enrichment analyses further supported these results, suggesting that swill promotes larval growth and metabolism, whereas pig manure induces the activation of stress response mechanisms. These findings offer clear molecular and physiological insights into the optimization of substrate selection for enhancing the performance of BSFL in waste management.