It is critical to accurately predict the remaining useful life (RUL) of rolling bearings to avoid severe accidents and financial losses in the industry. Nevertheless, accurately determining the initial prediction time (IPT) continues to pose a challenge, and significant differences in the data distribution of bearings under different operating conditions are frequently overlooked. To deal with these problems, we propose a novel two-stage method based on the adversarial strategy for RUL prediction of bearings under variable conditions. Firstly, we create reliable health indicators in an unsupervised manner by recording the coded characteristics of the bearing’s state of health. Secondly, an adaptive threshold method based on rate-of-change (ATMROC) is developed to perform accurate health state classification. Finally, we propose a RUL prediction network based on the attention depth-gated recurrent unit with domain invariance (DIADGRU) to handle the inconsistent distribution of degradation features under different operating conditions. Experiments of RUL prediction on PHM2012 and XITU-SY datasets are implemented, and the promising results validate the effectiveness of the proposed method.