Skip to content

Instantly share code, notes, and snippets.

@yeradis
Created August 4, 2017 11:50
Show Gist options
  • Save yeradis/b9b746bd028451bcdd9b5f784ac0ed90 to your computer and use it in GitHub Desktop.
Save yeradis/b9b746bd028451bcdd9b5f784ac0ed90 to your computer and use it in GitHub Desktop.
Exclude SKAdvisorResources.bundle from being copied within the app

I know this is an old question and probably you got a solution(or decided to use another library)

but just in case for future references

THIS WORKS ON MacOS for other systems you need to check your available tools find, sed

you can comment that line with something like this at your Podfile

post_install do |installer|    
    app_target = "your_target_goes_here"
    puts("* Commenting file `Pods-#{app_target}-resources.sh` line having `SKAdvisorResources.bundle`")
    system("find . -name \"Pods-#{app_target}-resources.sh\" -exec sed -i '' -e \"/SKAdvisorResources.bundle/s/^/#/\" {} +")
end

Lets add a little explanation here in case and update is needed xD

Explanation:

  • /SKAdvisorResources.bundle/ matches a line with SKAdvisorResources.bundle in it
  • s perform a substitution on the lines matched above
  • if something match, then will insert the hash character # at the beginning of the line ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment