Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Last active March 26, 2020 09:42
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/7690635 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/7690635 to your computer and use it in GitHub Desktop.
Disable NSLog with all CocoaPods with post_install hook.
post_install do | installer |
print "Updating #{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h\n"
open("#{installer.sandbox.target_support_files_root}/Pods/Pods-environment.h","a") do |file|
file.puts <<EOF
// Disable logs
#ifndef DEBUG
#define NSLog(...)
#endif
EOF
end
end
@zengyun-hacker
Copy link

Hi, it doesn't work since CocoaPods 0.39.0 as the file Pods-environment.h do not exist

@batrinuvlad
Copy link

@krzyzanowskim good idea, but this doesn't work anymore. We should somehow modify all the .pch files from pods. Any idea how?

@LuanSiHo
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment