Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will happen if a framework get deleted from an app?

I was asked a question, what will happen when a framework is accidentally deleted from your device may be iphone or mac?

Whether your application crash or it will work without any error?

Please provide me answer with explainations.

like image 805
Ileana D'Cruz Avatar asked Feb 22 '13 11:02

Ileana D'Cruz


2 Answers

If a framework is deleted, only software linking to that framework would be affected. If it is a system framework, expect your system to start failing. If it is a 3rd party framework, it should be limited in scope of impact. If it is in your app bundle, and your app is code-signed, the removal of the bundled framework should prevent your app from launching.

like image 32
uchuugaka Avatar answered Sep 23 '22 15:09

uchuugaka


You may get linking error. If framework folder is inside the application means its runtime linking.

OS X embeds an "install name" inside each dynamic library. This install name is the path to where the library can be found when dyld needs to load it. When you build an application that links against a dynamic library, this install name is copied into the application binary. When the application runs, the copied install name is then used to locate the library or framework.

   $ otool -D /Applications/Google\ Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python 
    /Applications/Google Drive.app/Contents/Frameworks/Python.framework/Versions/2.6/Python:
    @executable_path/../Frameworks/Python.framework/Versions/2.6/Python  

so if you will delete Frameworks folder you will get Dyld Error.

Dyld Error Message:
  Library not loaded: @loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle
  Referenced from: /Applications/Transmission.app/Contents/MacOS/Transmission
  Reason: image not found  

enter image description here

enter image description here

like image 116
Parag Bafna Avatar answered Sep 25 '22 15:09

Parag Bafna