The invention relates to a medicine for increasing male sexual function and treating erectile dysfunction and a preparation method thereof. The medicine comprises the following raw materials in partsby weight: 3-18 parts of poria cocos, 3-18 parts of coix seeds, 3-18 parts of citron, 5-30 parts of longan pulp, 3-18 parts of donkey-hide gelatin, 5-30 parts of penis cervi, 3-18 parts of cinnamon, 12 parts of wolfberry, 3-18 parts of clove, 5-30 parts of raspberry, 2-12 parts of fennel, 2-12 parts of fructus amomi, 3-18 parts of Chinese yam, 2-12 parts of polygala root, 2-12 parts of peach kernel, 3-18 parts of lumbricus, 2-12 parts of ginseng, 4-24 parts of male flower of eucommia ulmoides, and 5-30 parts of oyster peptide. The medicine is suitable for male population, increases energy, enhances male sexual function, and improves erectile dysfunction symptom.