How to get device make and model on iOS?

后端 未结 19 945
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 04:58

I was wondering if it\'s possible to determine what kind of iPhone (for example) the currentdevice is? I know it\'s possible to get the model through
NSString

19条回答
  •  北海茫月
    2020-11-22 05:05

    What about using ideviceinfo to get these values? Should be able to install it using brew install ideviceinfo

    Then run:

    PRODUCT_NAME=$(ideviceinfo --udid $DEVICE_UDID --key ProductName)
    PRODUCT_TYPE=$(ideviceinfo --udid $DEVICE_UDID --key ProductType)
    PRODUCT_VERSION=$(ideviceinfo --udid $DEVICE_UDID --key ProductVersion)
    

提交回复
热议问题