With increased uncertainty and instability worldwide, how to enhance the urban economy resilience effectively has become one main issue for urban economic development. Based on the measurement of the economic resilience of 241 cities at the prefecture level and above in China using the sensitive index method, we scrutinize the impact of industrial specialization agglomeration and diversification agglomeration on urban economic resilience. Results indicate that, during the impact resistance period, industrial diversification agglomeration, especially related industrial diversification agglomeration, can enhance urban economic resilience, whereas industrial specialization agglomeration has no positive effect. In contrast, during the period of recovery and adjustment, industrial specialization agglomeration can improve urban economic resilience, and industrial diversification agglomeration, especially related industrial diversification agglomeration, has no positive effect. Further analysis indicates that, under the interaction of specialization and diversification agglomerations, the effect of industrial agglomeration on urban economic resilience depends on the type of dual industrial agglomeration, showing remarkable heterogeneity. This study may provide useful references for policy makers concerned with urban resilience.