I accidentally deleted AddressBook.framework. Now when I restart my iMac the system can't load this framework thus nothing is working.
I have a bootable disk of macOS Sierra but going to recovery mode and installing macOS Sierra is not possible because downgrading High Sierra isn't allowed.
Formatting my disk will result in losing all my files because I don't have a Time Machine backup.
How can I restore AddressBook.framework to get my system working again.
Best Answer
Usually you would have to reinstall High Sierra in Recovery Mode. If you don't have access to another Mac running High Sierra locally and with limited download quota do the following:
Ask someone to upload High Sierra's AddressBook.framework as zip somewhere (e.g. a file sharing host) and submit the download link.
Boot to High Sierra's Recovery Mode.
Open Terminal and disable SIP (which should be disabled anyway or you wouldn't have been able to delete the framework).
Quit Terminal and open Safari. Enter the download link and save the zip file to /Volumes/< main_volume_name>/System/Library/Frameworks/
Alternatively (if the link doesn't allow to choose a download location, which can occur on some file sharing hosts) open the Preferences in Safari and set in General > File download location > "Ask for each download":
Then save the file to /Volumes/< main_volume_name>/System/Library/Frameworks/:
In the example below the name of the main volume is System. Your main volume name may be different (e.g. Macintosh HD or macOS).
Open Terminal and enter:
Depending on your Safari settings the zip will be unzipped automatically after the download and the next two steps (unzip/rm) aren't necessary!
check codesigning:
if this step fails delete AddressBook.framework and get a proper one.
Check the restricted flag:
which should show for . (the dot: . is the "bundle/package" AddressBook.framework here - the date will be different of course):
(You may have to add the restricted attribute to AddressBook.framework later if it's missing)