Search code examples
iosxcoderun-script

How to write a run script to unzip file in the project directory?


I need to create a run script that will un-zip a file a in the project source code directory and replace the existing files. My requirement in details is like this. I have aa.framework and bb.bundle in a zip file. Zip file is in the source code directory. Now, at the run time (Each time compile the app) I want to up-zip the zip file and replace existing aa.framework file bb.bundle file with the un-zipped files.

Please help me to write a run script to do this if this is doable.


Solution

  • You can get the path to to your project from the environment variable PROJECT_DIR. So you just call the zip and unzip commands.

    unzip "${PROJECT_DIR}/yourzip.zip"