Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Delphi iOS: getCPUName herausbekommen? (https://www.delphipraxis.net/205411-ios-getcpuname-herausbekommen.html)

philipp.hofmann 7. Sep 2020 11:03

iOS: getCPUName herausbekommen?
 
Hi,

habe ich eine Chance unter iOS den CPU-Name herauszubekommen. Folgende Funktion liefert ja jetzt nicht so viele Infos (iPad oder iPhone):

Delphi-Quellcode:
class function TStringUtils.getDeviceDetails():String;
{$IFDEF IOS}
  var Device : UIDevice;
{$ENDIF}
begin
  {$IFDEF IOS}
    Device := TUIDevice.Wrap(TUIDevice.OCClass.currentDevice);
    Result:=NSStrToStr(Device.model);
  {$ELSE}
    result:='';
  {$ENDIF}
end;
und Device.getCPUName wird leider nicht gefunden.

Grüße, Philipp

Rollo62 7. Sep 2020 11:42

AW: iOS: getCPUName herausbekommen?
 
Vielleicht muss man da mit festen switch/case Werten arbeiten,
so ähnlich wie hier.
https://github.com/InderKumarRathore/DeviceGuru

Ich denke die CPU-Namen/Typen sollten fest vorgegeben sein bei Apple.
https://en.wikipedia.org/wiki/List_of_iOS_devices

Hier ist mal eine fast aktuelle Liste
Delphi-Quellcode:
  switch identifier {
  case "iPod5,1":                                return ["A5":"800 MHz"] // underclocked
  case "iPod7,1":                                return ["A8":"1.4 GHz"]
  case "iPhone3,1", "iPhone3,2", "iPhone3,3":    return ["A4":"800 MHz"] // underclocked
  case "iPhone4,1":                              return ["A5":"800 MHz"] // underclocked
  case "iPhone5,1", "iPhone5,2":                 return ["A6":"1.3 GHz"]
  case "iPhone5,3", "iPhone5,4":                 return ["A6":"1.3 GHz"]
  case "iPhone6,1", "iPhone6,2":                 return ["A7":"1.3 GHz"]
  case "iPhone7,2":                              return ["A8":"1.4 GHz"]
  case "iPhone7,1":                              return ["A8":"1.4 GHz"]
  case "iPhone8,1":                              return ["A9":"1.85 GHz"]
  case "iPhone8,2":                              return ["A9":"1.85 GHz"]
  case "iPhone9,1", "iPhone9,3":                 return ["A10 Fusion":"2.34 GHz"]
  case "iPhone9,2", "iPhone9,4":                 return ["A10 Fusion":"2.34 GHz"]
  case "iPhone8,4":                              return ["A9":"1.85 GHz"]
  case "iPhone10,1", "iPhone10,4":               return ["A11 Bionic":"2.39 GHz"]
  case "iPhone10,2", "iPhone10,5":               return ["A11 Bionic":"2.39 GHz"]
  case "iPhone10,3", "iPhone10,6":               return ["A11 Bionic":"2.39 GHz"]
  case "iPad2,1", "iPad2,2", "iPad2,3", "iPad2,4":return ["A5":"1.0 GHz"]
  case "iPad3,1", "iPad3,2", "iPad3,3":          return ["A5X":"1.0 GHz"]
  case "iPad3,4", "iPad3,5", "iPad3,6":          return ["A6X":"1.4 GHz"]
  case "iPad4,1", "iPad4,2", "iPad4,3":          return ["A7":"1.4 GHz"]
  case "iPad5,3", "iPad5,4":                     return ["A8X":"1.5 GHz"]
  case "iPad6,11", "iPad6,12":                   return ["A9":"1.85 GHz"]
  case "iPad2,5", "iPad2,6", "iPad2,7":          return ["A5":"1.0 GHz"]
  case "iPad4,4", "iPad4,5", "iPad4,6":          return ["A7":"1.3 GHz"]
  case "iPad4,7", "iPad4,8", "iPad4,9":          return ["A7":"1.3 GHz"]
  case "iPad5,1", "iPad5,2":                     return ["A8":"1.5 GHz"]
  case "iPad6,3", "iPad6,4":                     return ["A9X":"2.16 GHz"] // underclocked
  case "iPad6,7", "iPad6,8":                     return ["A9X":"2.24 GHz"]
  case "iPad7,1", "iPad7,2":                     return ["A10X Fusion":"2.34 GHz"]
  case "iPad7,3", "iPad7,4":                     return ["A10X Fusion":"2.34 GHz"]
  case "AppleTV5,3":                             return ["A8":"1.4 GHz"]
  case "AppleTV6,2":                             return ["A10X Fusion":"2.34 GHz"]
  case "AudioAccessory1,1":                      return ["A8":"1.4 GHz"] // clock speed is a guess
  default:                                       return ["N/A":"N/A"]
  }

}

philipp.hofmann 7. Sep 2020 14:20

AW: iOS: getCPUName herausbekommen?
 
Device.model liefert wirklich nur die Info "iPad", da kann man also noch nichts von ableiten.
Selbiges gilt für Device.name und Device.localizedModel liefert auch nicht mehr erhellendes.
Ja, wenn ich das Attribut kenne für den echten Typnames des Devices, würde mir das reichen.

Rollo62 7. Sep 2020 15:34

AW: iOS: getCPUName herausbekommen?
 
Naja, nichts ist einfach.
Wer denkt sich das bloss aus bei Apple ?

https://www.tutorialspoint.com/how-t...ith-iphone-sdk

das wird hier irgendwie verwurschelt.
https://github.com/devicekit/DeviceK...enerated.swift

Kommt man da mit Delphi an das utsname systeminfo ran ?


Kann im Moment nicht nachschauen, installiere gerade 10.4.1


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:38 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz