Skip to content

Instantly share code, notes, and snippets.

@annidy
Last active June 16, 2020 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annidy/ab61ebcef18d3bc71a4cb31469472827 to your computer and use it in GitHub Desktop.
Save annidy/ab61ebcef18d3bc71a4cb31469472827 to your computer and use it in GitHub Desktop.
require 'xcodeproj'
project_path = Dir.glob("*.xcodeproj")[0]
project = Xcodeproj::Project.open(project_path)
project.targets.select {
|target| target.name.include? "InHouse"
}.each { |target|
puts "Process " + target.name + "..."
puts "Delete copy phases", target.copy_files_build_phases
target.copy_files_build_phases.each { |phases|
phases.remove_from_project
}
puts "Delete dependencies"
target.dependencies.clear
}
puts "Remove entitlements"
Dir.glob('*.entitlements').each do|ent|
puts ent
File.open(ent, 'w') do |f|
# use "\n" for two lines of text
f.puts <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.bytedance.keychainshare</string>
</array>
</dict>
</plist>
EOS
end
end
project.save(project.path)
system('./debug.sh')
system('open *.xcworkspace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment