我正在尝试将plist文件从本地目录复制到Xcode的Resources目录:
file_path = "/some_path_to/IDETextKeyBindingSet.plist"
destination_path = "/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources"
FileUtils.chmod(0755, destination_path)
FileUtils.cp(file_path, destination_path)
但我得到这个错误:
/opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/fileutils.rb:1324:in `lchmod': Permission denied @ apply2files - /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources (Errno::EACCES)
from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/fileutils.rb:1324:in `chmod'
from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/fileutils.rb:1002:in `block in chmod'
from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/fileutils.rb:1001:in `each'
from /opt/homebrew/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/fileutils.rb:1001:in `chmod'
我如何解决这个问题,并在我需要将此文件复制到的目录中强制写入权限?
1条答案
按热度按时间qv7cva1a1#
我正在尝试将plist文件从本地目录复制到Xcode的Resources目录
请不要尝试这样做。不允许修改应用包的内容。