  We discuss the production of $\gamma$-rays from cosmic rays (CR) in the
circumgalactic medium (CGM) of Andromeda (M31) in light of the recent detection
of $\gamma$-rays from an annular region of $\sim 5.5-120$ kpc away from the M31
disc. We consider the CRs accelerated as a result of the star-formation in the
M31 disk, which are lifted to the CGM by advection due to outflow and CR
diffusion. The advection time scale due to bulk flow of gas triggered by star
formation activity in the M31 disc is comparable ($\sim$ Gyr) to the diffusion
time scale with diffusion coefficient $\ge10^{29}$ cm$^2$ s$^{-1}$ for the
propagation of CR protons with energy $\sim 412$ GeV that are responsible for
the highest energy photons observed. We show that a leptonic origin of the
$\gamma$-rays from cosmic ray (CR) electrons has difficulties, as the inverse
Compton time scale ($\sim$Myr) is much lower than advection time scale
($\sim$Gyr) to reach $120$ kpc. Invoking CR electrons accelerated by accretion
shocks in the CGM at $\sim100-120$ kpc does not help since it would lead to
diffuse X-ray features that are not observed. We, therefore, study the
production of $\gamma$-rays via hadronic interaction between CR protons and CGM
gas with the help of numerical two-fluid (thermal + CR) hydrodynamical
simulation. We find that a combination of these mechanisms, that are related to
the star formation processes in M31 in the last $\sim $ Gyr, along with
diffusion and hadronic interaction, can explain the observed flux from the CGM
of M31.
