Domestic for some reason, download cm or Google official Android source code is always easy to break. Always looking at the machine, it's too cumbersome to re-execute repo sync as soon as I interrupt, so I wrote a shell script (download.sh) deliberately. Decide whether to execute the Repo Sync command again by getting the status code that the shell returned last.
#!/bin/BashEcho "======start Repo sync======"RepoSync# download Android source code for the first time while[ $? !=0]; Do Echo "======sync failed, Re-sync again======" Sleep 2RepoSync# If it goes wrong, call repo sync again after 2 seconds to download Android source code Done
Where "$?" You can get the state of the shell's most recent execution, and if it succeeds, returns 0, otherwise it returns a number other than 0. Copy the script (download.sh) to the root directory of the Android source code and execute the script. It doesn't matter if it's interrupted.
Download a shell script that automatically restarts Google's official/cm Android source code