machine

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the machine
machine()
Summary

Returns the type of hardware the application is running on.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
the machine
if the machine contains "Powerbook" then checkBattery
Values
NameTypeDescription
return

The machine function returns a string.

x86: windows 32 bit based system
x86_64: windows 64 bit based system
iPod Touch: the device is one of the iPod Touch models
iPhone: the device is one of the iPhone models
iPhone Simulator: the device is a simulated iPhone
iPad: the device is the iPad
iPad Simulator: the device is a simulator iPad
RelatedKeyword: string
Function: processor
Glossary: application, return
Control Structure: function
Description

Use the machine function to detect what type of system your application is running on.

On Mac OS systems, the machine function uses the Gestalt() system call to determine the machine type.

On Unix systems, the machine function uses the uname() system function.

On Android devices, the machine function returns the manufacturer's name for the device. For example, if running on a Google Nexus One, the string is "Nexus One".