Ruby如何在Xcodeproj中获取目标版本(您的 APP 版本)?
我已经尝试sdk_version使用AbstractTargetXcodeproj,但它返回 nil。
如果Xcodeproj不支持。如何获得版本Ruby?
我使用plist gem 在 Ruby 中做到了这一点,如下所示:
require 'plist'
info = Plist.parse_xml('path/to/Info.plist')
puts info["CFBundleShortVersionString"]
puts info["CFBundleVersion"]
我希望它有所帮助。
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString")应该给你版本号Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion")应该给你内部版本号