machine

returns the type of hardware the application is running on.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux, ios, android Introduced: 1.0 Security:

# Syntax

the machine

# Examples

the machine

if the machine contains "Powerbook" then checkBattery

# 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".

# Tags

# See

- **keyword:** string - **function:** processor - **glossary:** application, return - **control structure:** function