11

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.

enter image description here

grg
  • 201,078
Sayan
  • 2,269

2 Answers2

14

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":

    enter image description here

    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).

    enter image description here

    enter image description here

  • Open Terminal and enter:

    cd /Volumes/<main_volume_name>/System/Library/Frameworks/
    

    Depending on your Safari settings the zip will be unzipped automatically after the download and the next two steps (unzip/rm) aren't necessary!

    /Volumes/<main_volume_name>/usr/bin/unzip -a AddressBook.framework.zip
    rm AddressBook.framework.zip
    
  • check codesigning:

    codesign -dv --verbose=4 AddressBook.framework
    

    if this step fails delete AddressBook.framework and get a proper one.

  • Check the restricted flag:

    ls -laO AddressBook.framework
    

    which should show for . (the dot: . is the "bundle/package" AddressBook.framework here - the date will be different of course):

    drwxr-xr-x    7 root  wheel restricted 224 Sep 25 21.59 .
    ...
    

    (You may have to add the restricted attribute to AddressBook.framework later if it's missing)

  • (Enable SIP) and reboot.
klanomath
  • 66,391
  • 9
  • 130
  • 201
  • 1
    Can you upload the framework as zip? – Sayan Sep 28 '17 at 16:08
  • 1
    And how to save the file to /Volumes/<​main_volume_name>/System/Library/Frameworks/ and what should I insert here: <​main_volume_name> – Sayan Sep 28 '17 at 16:11
  • 1
    macOS sierra by default sets the name to macOS now you seem to be pretty active so can you upload the zip here https://dbr.ee – Sayan Sep 28 '17 at 16:17
  • 1
    So now that the file is in its original location should I skip step 5? – Sayan Sep 28 '17 at 17:07
  • Codesign step output: no such file or directory! – Sayan Sep 28 '17 at 17:15
  • You said to continue with step 6 so I skipped all the previous steps! – Sayan Sep 28 '17 at 17:18
  • Output for all the above mentioned steps: https://dbr.ee/bLzA – Sayan Sep 28 '17 at 17:35
  • Hurrah! Everyhting working as smooth as butter and the file which you provide me was it off macOS Sierra or High Sierra and how can I introduce an exception for macOS to skip searching or loading this framework while booting up and loading all the files? – Sayan Sep 28 '17 at 17:42
  • @Sayan It's the High Sierra version of course. I'd assume that all frameworks in /System/Library/Frameworks/ are required to boot and run macOS properly = those (and other files/bundles) are the normal operating system. You can't "skip" any of them. – klanomath Sep 28 '17 at 17:46
  • @Sayan Now that things are working again, make a backup of anything you don't want to lose! Especially, do it before you do any more experimenting with the OS. – Gordon Davisson Sep 29 '17 at 02:06
  • 2
    @GordonDavisson No questions asked, I did it as soon as I got my Mac working again! – Sayan Sep 29 '17 at 03:07
4

Ok I will give another easy answer first boot to recovery partition by holding CMD+R at startup chime then after it finishes booting click utilities in the upper panel then click terminal type csrutil disable then restart the your Mac Now once you hear the startup chime hold CMD+S till you see plain text now do the following steps:

• First type mount -uw / • Then plug in another high capacity pendrive • then type mkdir /usb • then type mount -t [filesyatem of pendrive] /dev/disk2s1 /usb

• Now we are going to copy the entire home directory from your MacBook to the pendrive Tip: you can find out the size of your home directory by ls -la /Users • Then type rsync -p -P -o /Users --exclude /Users/your username/Library /Users /usb

Then you can reinstall the OS again by asking a friend by giving a bootable os.

  • 1
    I was also thinking of a step like this but in a different way, I was trying to restore the Home directory via Disk Utility to an External USB Stick, but restoring was not successful, Disk utility was giving me an error like this that the drive is not Apple Format.....I don't remember the term! – Sayan Sep 29 '17 at 03:08
  • 1
    Did you try my way it should not show any error this command is tested by me. –  Sep 29 '17 at 03:20
  • 1
    Actually the accepted answer is working, I got errors cause I skipped some steps, by the way your step is easy too! – Sayan Sep 29 '17 at 03:27