MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / printDeviceInfoIOS

Function printDeviceInfoIOS

apps/automated/src/pages/page5.ts:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26function printDeviceInfoIOS() {
27 var device = UIDevice.currentDevice;
28 console.log('device.name = ' + device.name); //device.name = iPhone Simulator
29 console.log('device.systemName = ' + device.systemName); //device.systemName = iPhone OS
30 console.log('device.systemVersion = ' + device.systemVersion); //device.systemVersion = 8.1
31 console.log('device.model = ' + device.model); //device.model = iPhone Simulator
32 console.log('device.localizedModel = ' + device.localizedModel); //device.localizedModel = iPhone Simulator
33 console.log('device.userInterfaceIdiom = ' + device.userInterfaceIdiom); //device.userInterfaceIdiom = 0
34 console.log('device.batteryLevel = ' + device.batteryLevel); //device.batteryLevel = -1
35 var screen = UIScreen.mainScreen;
36 console.log('screen = ' + screen);
37 console.log('screen.nativeBounds = ' + screen.nativeBounds.size.width + ', ' + screen.nativeBounds.size.height); //screen.nativeBounds = 640, 1136
38 console.log('screen.scale = ' + screen.scale); //screen.scale = 2
39 console.log('screen.nativeScale = ' + screen.nativeScale); //screen.nativeScale = 2
40}
41
42function printTNSInfo() {
43 console.log('platform.Device.model = ' + platform.Device.model);

Callers 1

printFunction · 0.85

Calls 1

logMethod · 0.45

Tested by

no test coverage detected