CSSystemInfoHelper 2.0.1

CSSystemInfoHelper 2.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jun 2021

Maintained by Cătălin Stan.



Version Status Platform Carthage compatible MIT License

CSSystemInfoHelper

A utility library for getting system info. It’s meant to provide a more straightforward way of accessing information only available through C APIs and to provide shorthands for the most common usage scenarios.

I’ve used this library when making the criollo.io website in order to display the system the app is running on.

Getting Started

Installation through CocoaPods

Install using CocoaPods by adding this line to your Podfile:

use_frameworks!

target 'MyApp' do
  pod 'CSSystemInfoHelper', '~> 1.2'
end

In your Project

import CSSystemInfoHelper

print("\(CSSystemInfoHelper.sharedHelper().systemInfoString)"

Examples

Please note that you can also see usage examples in the example app

Getting IPv4 interfaces and addresses

for (ifname, ipaddr) in CSSystemInfoHelper.sharedHelper().AllIPAddresses {
    print("\(ifname): \(ipaddr)")
}

Getting System Info from uname(3)

for (key, value) in CSSystemInfoHelper.sharedHelper().systemInfo {
    print("\(key): \(value)")
}

Getting Human-readable Memory Usage

print(CSSystemInfoHelper.sharedHelper().memoryUsageString)

Getting the device UUID

print(CSSystemInfoHelper.sharedHelper().platformUUID)

on watchOS this cannot yet be done programmatically, so the returned UUID is generated on-the-fly.

What’s Next

Check out the complete documentation on CocoaDocs.