Low-temperature alpha-phase stabilization using HI or zwitterions in cesium lead iodide (CsPbI3) endures the metastable phase properties but is thermally unstable. Doping with a small amount of heterovalent metals (i.e., Bi3+, Sb3+) in CsPbI(3)has been assumed to stabilize the alpha-phase, while here this assumption is challenged. It is demonstrated that heterovalent metal ion doping stabilizes beta-CsPbI3 at low temperatures without replacing the Pb(2+)cations, while divalent cations (i.e., Ba2+, Sr2+, and Sn2+) doping stabilizes the alpha-CsPbI3 by replacing the Pb(2+)cations. This finding is demonstrated by both theoretical and experimental results. It is also found that the divalent cations stabilize alpha-CsPbI3 films, making thermally stable at high temperatures, whereas heterovalent metal-doping stabilizes beta-CsPbI3 films, making metastable. The doping influence on crystal grains and the chemical composition of thin films is discussed. In particular, the charge dissociation kinetics for the Sr doped thin film are much enhanced than alpha-CsPbI(3)and Ba doped thin films, also the initial results of the fabricated perovskite red-light-emmiting diode suggests that the Sr-doped thin films would be more suitable for the device fabrication. These findings will guide a way for further development in thermally and air-stable optoelectronic devices.