如何通过Ruby(或Xcodeproj)获取目标版本 [英] How to get target's version by Ruby (or Xcodeproj)

查看:83
本文介绍了如何通过Ruby(或Xcodeproj)获取目标版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Ruby Xcodeproj中获取目标版本(您的APP版本)?

我已经在Xcodeproj中尝试了 AbstractTarget 中的 sdk_version ,但是返回nil.

I have tried sdk_version in AbstractTarget with Xcodeproj, But it returns nil.

如果 Xcodeproj 不支持它.如何通过 Ruby 获取版本?

If Xcodeproj doesn't support it. How to get the version by Ruby?

推荐答案

我在Ruby中使用 plist 宝石,像这样:

I did this in Ruby using the plist gem, like this:

require 'plist'
info = Plist.parse_xml('path/to/Info.plist')
puts info["CFBundleShortVersionString"]
puts info["CFBundleVersion"]

希望对您有帮助.

这篇关于如何通过Ruby(或Xcodeproj)获取目标版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆