[英]iOS: How to ascertain the CPU type, e.g. A4 or A5, or instruction set architecture arm6 or arm7?
Apple是否提供可以访问此信息的API?
ARM是否具有与我可以在asm块中使用的x86 CPUID指令相同的功能?
谢谢。
Erica Sadun撰写了许多有用的查询。 我会开始检查你的uidevice扩展代码,看看你是否能找到你想要的东西。
https://github.com/erica/uidevice-extension
此外,正如Gapton所说,请记住,某些设备查询不会获得App Store批准,尤其是未发布的设备查询,但其中相当数量的设备可以使用。
我需要CPU模型信息和指令集。 所以我尝试尽可能简单:
std::string GetCPUModel()
{
// you can compare results with https://www.theiphonewiki.com/wiki/List_of_iPhones
struct utsname systemInfo;
uname(&systemInfo);
std::string version(systemInfo.version);
size_t cpuModelPos = version.find("RELEASE_");
if (cpuModelPos != String::npos)
{
// for example: will return "ARM64_S8000" - for iPhone S6 plus
return version.substr(cpuModelPos + strlen("RELEASE_"));
}
return {};
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.