Last active
June 16, 2020 04:16
-
-
Save annidy/ab61ebcef18d3bc71a4cb31469472827 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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