artehe / Netimobiledevice

A C#/dotnet implementation for working with iOS devices (iPhone, iPad, iPod).
https://github.com/artehe/Netimobiledevice
MIT License
14 stars 7 forks source link

How to get the connected iOS device model? #13

Closed Elanchezhiyan-P closed 6 months ago

Elanchezhiyan-P commented 7 months ago

Hey @artehe ,

I have checked the library and we are able to get the OS version as 15.8 as like that. Do we have the option to get the device model such as IPhone 7 or IPhone 15 ?

artehe commented 7 months ago

Yes you can.

I made a change which adds getting the internal device model which comes across as a string like this "iPhone16,2" you should be able to use this like:

using (LockdownClient lockdown = LockdownClient.CreateLockdownClient(udid)) {
            string internalModel= lockdown.Product;
}

If you wanted to get the more friendly name you'd have to add a mapping of some kind to translate this. So from the example above the value "iPhone16,2" would translate to "iPhone 15 Pro Max"

Elanchezhiyan-P commented 7 months ago

@artehe ,

Thanks for the suggestion. We have identified with the same code and we got the mobile model identifiers. We have also got the list from this site. We are checking for the public API to get the device model based on the model identifier. Let me know if there is any available.

artehe commented 7 months ago

One thing you could do is just add another property to LockdownClient which is something like ProductFriendlyName. Then internally there's just a list of all the models somewhere and their nice names which are returned.

This sound reasonable to you?

Elanchezhiyan-P commented 7 months ago

@artehe ,

Yeah, I can do that. I have the list and we can print the ProductFriendlyName.

Elanchezhiyan-P commented 6 months ago

@artehe,

I have raised the PR for iPhone Models. Please take a look and let me know if there is anything to be updated.