---
title: environment
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/process/environment
---

# environment

The environment for the receiver.

## Declaration

```swift
var environment: [String : String]? { get set }
```

## Parameters

- `environmentDictionary`: A dictionary of environment variable values whose keys are the variable names.

## Discussion

Discussion If this method isn’t used, the environment is inherited from the process that created the receiver. This method raises an NSInvalidArgumentException if the system has launched the receiver.

## See Also

### Configuring a process

- [arguments](foundation/process/arguments.md)
- [currentDirectoryURL](foundation/process/currentdirectoryurl.md)
- [executableURL](foundation/process/executableurl.md)
- [qualityOfService](foundation/process/qualityofservice.md)
- [standardError](foundation/process/standarderror.md)
- [standardInput](foundation/process/standardinput.md)
- [standardOutput](foundation/process/standardoutput.md)
