{"id":15034532,"url":"https://github.com/lmirosevic/gbdeviceinfo","last_synced_at":"2025-05-15T08:02:37.482Z","repository":{"id":2966504,"uuid":"3981346","full_name":"lmirosevic/GBDeviceInfo","owner":"lmirosevic","description":"Detects the hardware, software and display of the current iOS or Mac OS X device at runtime.","archived":false,"fork":false,"pushed_at":"2024-07-16T05:12:34.000Z","size":317,"stargazers_count":1144,"open_issues_count":6,"forks_count":192,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-04-03T15:07:39.186Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmirosevic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-10T10:58:18.000Z","updated_at":"2025-02-26T11:54:59.000Z","dependencies_parsed_at":"2023-02-15T10:31:25.751Z","dependency_job_id":"df4dbc3d-9788-4b6c-bd27-cc30425aa528","html_url":"https://github.com/lmirosevic/GBDeviceInfo","commit_stats":{"total_commits":223,"total_committers":45,"mean_commits":4.955555555555556,"dds":0.5246636771300448,"last_synced_commit":"f746467bc807c4014adf8acbb6524e3326388d73"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmirosevic%2FGBDeviceInfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmirosevic%2FGBDeviceInfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmirosevic%2FGBDeviceInfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmirosevic%2FGBDeviceInfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmirosevic","download_url":"https://codeload.github.com/lmirosevic/GBDeviceInfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248423294,"owners_count":21100960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-09-24T20:25:24.875Z","updated_at":"2025-04-11T14:49:00.336Z","avatar_url":"https://github.com/lmirosevic.png","language":"Objective-C","funding_links":[],"categories":["\u003ca id=\"58cd9084afafd3cd293564c1d615dd7f\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"d0108e91e6863289f89084ff09df39d0\"\u003e\u003c/a\u003e新添加的"],"readme":"![GBDeviceInfo logo](https://raw.githubusercontent.com/lmirosevic/GBDeviceInfo/master/logo.png)\n\nDetects the hardware, software and display of the current iOS or Mac OS X device at runtime.\n\n![Version](https://img.shields.io/cocoapods/v/GBDeviceInfo.svg?style=flat)\u0026nbsp;![License](https://img.shields.io/badge/license-Apache_2-green.svg?style=flat)\n\niOS\n------------\n\nSimple usage (examples on iPhone 6 running iOS 8.1.3):\n\n```objective-c\n[[GBDeviceInfo deviceInfo] isOperatingSystemAtLeastVersion:@\"8.0\"]; // #\u003e YES\n\n[GBDeviceInfo deviceInfo].isJailbroken;                             // #\u003e NO\n\n[GBDeviceInfo deviceInfo].model;                                    // #\u003e GBDeviceModeliPhone6\n[GBDeviceInfo deviceInfo].family;                                   // #\u003e GBDeviceFamilyiPad\n\n[GBDeviceInfo deviceInfo].modelString;                              // #\u003e @\"iPhone 6\"\n[GBDeviceInfo deviceInfo].osVersion.major;                          // #\u003e 8\n[GBDeviceInfo deviceInfo].osVersion.minor;                          // #\u003e 1\n\n[GBDeviceInfo deviceInfo].displayInfo.pixelsPerInch;                // #\u003e 326\n```\n\nYou can also reuse the returned object to save some typing. First assign the object to some variable:\n\n```objective-c\nGBDeviceInfo *deviceInfo = [GBDeviceInfo deviceInfo];\n```\n\nThen get whatever you like from the object:\n\n```objective-c\n//Model numbers\nNSLog(@\"Major device ver: %d\", deviceInfo.deviceVersion.major);     // Major device ver: 7\nNSLog(@\"Major device ver: %d\", deviceInfo.deviceVersion.minor);     // Minor device ver: 2\n\n\n//Specific model\nif (deviceInfo.model == GBDeviceModeliPhone6) {\n    NSLog(@\"It's a 6\");                                             // It's a 6\n}\n\n//Family of device\nif (deviceInfo.family != GBDeviceFamilyiPad) {\n    NSLog(@\"It's not an iPad\");                                     // It's not an iPad\n}\n\n//Screen type\nif (deviceInfo.display == GBDeviceDisplayiPhone4p7Inch) {\n    NSLog(@\"4.7 Inch display\");                                     // 4.7 Inch display\n}\n\n//iOS Version\nif (deviceInfo.majoriOSVersion \u003e= 6) {\n    NSLog(@\"We've got iOS 6+\");                                     // We've got iOS 6+\n}\n\n//Raw systemInfo string\nNSLog(@\"systemInfo: %@\", deviceInfo.rawSystemInfoString);           // systemInfo: iPhone7,2\n```\n\nDon't forget to import header.\n\n```objective-c\n#import \u003cGBDeviceInfo/GBDeviceInfo.h\u003e\n```\n\nIf you want to use the `isJailbroken` property, make sure you first add the Jailbreak subspec to your project's Podfile, e.g.:\n```ruby\npod 'GBDeviceInfo', '~\u003e 6.0'\npod 'GBDeviceInfo/Jailbreak', '~\u003e 6.0'\n```\n\nMissing a property you need? Submit a Pull Request or contact [sales@goonbee.com](mailto:sales@goonbee.com?subject=GBDeviceInfo%20Enterprise)!\n\nOS X\n------------\n\nSimple usage (examples on a Mac Pro with an Ivy Bridge 3770K processor running 10.8.2):\n\n```objective-c\n[[GBDeviceInfo deviceInfo] isOperatingSystemAtLeastVersion:@\"10.8\"]; // #\u003e YES\n\n[GBDeviceInfo deviceInfo].osVersion.major;                           // #\u003e 10\n[GBDeviceInfo deviceInfo].osVersion.minor;                           // #\u003e 8\n[GBDeviceInfo deviceInfo].family == GBDeviceFamilyMacPro;            // #\u003e YES\n[GBDeviceInfo deviceInfo].isMacAppStoreAvailable;                    // #\u003e YES\n[GBDeviceInfo deviceInfo].isIAPAvailable;                            // #\u003e YES\n```\n\nYou can also reuse the returned object to save some typing. First assign the object to some variable:\n\n```objective-c\nGBDeviceInfo *deviceInfo = [GBDeviceInfo deviceInfo];\n```\n\nThen get whatever you like from the object:\n\n```objective-c\nGBDeviceInfo *deviceInfo = [GBDeviceInfo deviceInfo];\n\n//OS X Version\nif (deviceInfo.osVersion.minor \u003e= 8) {\n    NSLog(@\"It's OS X 10.8+ (Mountain Lion)\");                     // It's OS X 10.8+ (Mountain Lion)\n}\nif (deviceInfo.osVersion.patch == 2) {\n    NSLog(@\"Must be running x.x.2\");                               // Must be running x.x.2\n}\n\n//App Store stuff\nif (deviceInfo.isMacAppStoreAvailable) {\n    NSLog(@\"App store is available.\");                             // App store is available\n}\nif (deviceInfo.isIAPAvailable) {\n    NSLog(@\"...and so are IAPs\");                                  // ...and so are IAPs\n}\n\n//Hardware stuff\nNSLog(@\"SystemInfo: %@\", deviceInfo.rawSystemInfoString);          // SystemInfo: MacPro3,1\nNSLog(@\"Major device ver: %d\", deviceInfo.deviceVersion.major);    // Major device ver: 3\nNSLog(@\"Minor device ver: %d\", deviceInfo.deviceVersion.minor);    // Minor device ver: 1\nNSLog(@\"Node name: %@\", deviceInfo.nodeName);                      // Node name: MyMac.local\nNSLog(@\"RAM: %.3f GB\", deviceInfo.physicalMemory);                 // RAM: 16.000 GB\nNSLog(@\"CPU freq: %.3f GHz\", deviceInfo.cpu.frequency);            // CPU freq: 3.500 GHz\nNSLog(@\"Number of cores: %d\", deviceInfo.cpu.numberOfCores);       // Number of cores: 8\nNSLog(@\"L2 Cache size: %.0f KB\", deviceInfo.cpu.l2CacheSize);      // L2 Cache size: 256 KB\n\n//Endianness\nif (deviceInfo.byteOrder == GBByteOrderLittleEndian) {\n    NSLog(@\"Little Endian\");                                       // Little Endian\n}\n\n//Family of device\nif (deviceInfo.family != GBDeviceFamilyMacBookAir) {\n    NSLog(@\"It's not a Macbook Air\");                              // It's not a Macbook Air\n}\n\n//Screen resolution\nif (deviceInfo.screenResolution.width == 1920 \u0026\u0026 deviceInfo.screenResolution.height == 1200) {\n    NSLog(@\"Resolution: 1920x1200\");                              // Resolution: 1920x1200\n}\n```\n\nDon't forget to import framework:\n\n```objective-c\n#import \u003cGBDeviceInfo/GBDeviceInfo.h\u003e\n```\n\nMissing a property you need? Submit a Pull Request or contact [sales@goonbee.com](mailto:sales@goonbee.com?subject=GBDeviceInfo%20Enterprise)!\n\niOS Device support\n------------\n\n* iPhone1\n* iPhone3G\n* iPhone3GS\n* iPhone4\n* iPhone4S\n* iPhone5\n* iPhone5C\n* iPhone5S\n* iPhone6\n* iPhone6Plus\n* iPhone6S\n* iPhone6SPlus\n* iPhone7\n* iPhone7Plus\n* iPhone8\n* iPhone8Plus\n* iPhoneSE\n* iPhoneSE2\n* iPhoneSE3\n* iPhoneX\n* iPhoneXR\n* iPhoneXS\n* iPhoneXSMax\n* iPhone11\n* iPhone11Pro\n* iPhone11ProMax\n* iPhone12Mini\n* iPhone12\n* iPhone12Pro\n* iPhone12ProMax\n* iPhone13Mini\n* iPhone13\n* iPhone13Pro\n* iPhone13ProMax\n* iPhone14\n* iPhone14Plus\n* iPhone14Pro\n* iPhone14ProMax\n* iPhone15\n* iPhone15Plus\n* iPhone15Pro\n* iPhone15ProMax\n* iPad1\n* iPad2\n* iPad3\n* iPad4\n* iPad5\n* iPad6\n* iPad7\n* iPad8\n* iPad9\n* iPad10\n* iPadMini1\n* iPadMini2\n* iPadMini3\n* iPadMini4\n* iPadMini5\n* iPadMini6\n* iPadAir1\n* iPadAir2\n* iPadAir3\n* iPadAir4\n* iPadAir5\n* iPadPro9p7Inch\n* iPadPro10p5Inch\n* iPadPro12p9Inch\n* iPadPro12p9Inch2\n* iPadPro11Inch\n* iPadPro11Inch2\n* iPadPro12p9Inch3\n* iPadPro12p9Inch4\n* iPadPro11Inch3\n* iPadPro12p9Inch5\n* iPadPro11Inch4\n* iPadPro12p9Inch6\n* iPod1\n* iPod2\n* iPod3\n* iPod4\n* iPod5\n* iPod6\n* iPod7\n* iPhone Simulator\n* iPad Simulator\n\nOS X Device family support\n------------\n\n* iMac\n* iMacPro\n* MacMini\n* MacStudio\n* MacPro\n* MacBook\n* MacBookAir\n* MacBookPro\n* Xserve\n\nAuthor\n------------\n\n[Luka Mirosevic](mailto:luka@goonbee.com) ([@lmirosevic](https://twitter.com/lmirosevic))\n\nEnterprise\n------------\n\nPremium support, integration, use-case adaptations and consulting available. Contact [sales@goonbee.com](mailto:sales@goonbee.com?subject=GBDeviceInfo%20Enterprise).\n\nCopyright \u0026 License\n------------\n\nCopyright 2015 Goonbee\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmirosevic%2Fgbdeviceinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmirosevic%2Fgbdeviceinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmirosevic%2Fgbdeviceinfo/lists"}