Human mobility restriction policies have been widely used to contain the coronavirus disease-19 (COVID-19). However, a critical question is how these policies affect individuals’ behavioral and psychological well-being during and after confinement periods. Here, we analyze China’s five most stringent city-level lockdowns in 2021, treating them as natural experiments that allow for examining behavioral changes in millions of people through smartphone application use. We made three fundamental observations. First, the use of physical and economic activity-related apps experienced a steep decline, yet apps that provide daily necessities maintained normal usage. Second, apps that fulfilled lower-level human needs, such as working, socializing, information seeking, and entertainment, saw an immediate and substantial increase in screen time. Those that satisfied higher-level needs, such as education, only attracted delayed attention. Third, human behaviors demonstrated resilience as most routines resumed after the lockdowns were lifted. Nonetheless, long-term lifestyle changes were observed, as significant numbers of people chose to continue working and learning online, becoming “digital residents.” This study also demonstrates the capability of smartphone screen time analytics in the study of human behaviors.Supplementary InformationThe online version contains supplementary material available at 10.1140/epjds/s13688-023-00391-9.