The invention discloses 2-aminopyrimidine compounds as well as pharmaceutical compositions and applications thereof. The structure of the 2-aminopyrimidine compounds is shown in the formula I, definitions of R1, R2, R3, R4, R5, X, Y, Z and W in the formula are shown in the specification and the claim. The compounds can effectively inhibit growths of a plurality of tumor cells, generate inhibition effects for EGFR and IGF1R protease, and is used for preparing antitumor drugs; the compounds can overcome drug resistance which is induced by prior medicaments Gefitinib and Erlotinib and the like, has selectivity for tumor, especially wild type non-small cell lung cancers, and has good pharmacokinetics property.