This paper studies the massive machine-Type communications (mMTC) for the future Internet of Things (IoT) applications. Building upon the fact that the covariance matrix of the received signal can be accurately estimated in the spatial domain if the base station (BS) is equipped with a massive number of antennas, we propose a covariance-based device activity detection and channel estimation strategy in a massive MIMO (multiple-input multiple-output) aided mMTC system. For this strategy, a novel approach for the pilot sequence design is first provided, where the pilot of each device is merely determined by a unique phase parameter. Then, by estimating the phase parameters of the active pilot sequences that contribute to the received covariance matrix, an efficient algorithm is proposed to detect the active devices without the prior information about the total number of active devices. At last, given the estimation of active devices, channel estimation is conducted based on the conventional minimum mean-squared error (MMSE) approach. It is worth noting that our proposed strategy is able to obtain all the results in closed-forms, and is thus of much lower complexity compared to the existing strategies that are based on iterative algorithms for device detection and channel estimation.