---
title: LaunchCodeRequirement
framework: lightweightcoderequirements
role: symbol
role_heading: Structure
path: lightweightcoderequirements/launchcoderequirement
---

# LaunchCodeRequirement

A lightweight code requirement that you use to evaluate the executable for a launching process.

## Declaration

```swift
struct LaunchCodeRequirement
```

## Overview

Overview If you set a LaunchCodeRequirement object for a launching process and the executable doesn’t satisfy the requirement, the operating system doesn’t run the process and creates a crash report instead. LaunchCodeRequirement objects can only be built using constraints that conform to the LaunchConstraint protocol. Note that LaunchCodeRequirement are applied to processes. If a launch requests execution of ‘#!’ script, the launch constraint will be applied to the interpreter. For example a script with the following ‘#!’ will apply a launch constraint to bash. #! /bin/bash if the ‘#!’ is instead:  #! /usr/bin/env python Then the launch constraint is applied to env.

## Topics

### Initializers

- [init(_:)](lightweightcoderequirements/launchcoderequirement/init(_:)-5fh0u.md)
- [init(_:)](lightweightcoderequirements/launchcoderequirement/init(_:)-6hixy.md)
- [init(from:)](lightweightcoderequirements/launchcoderequirement/init(from:).md)

### Instance Methods

- [encode(to:)](lightweightcoderequirements/launchcoderequirement/encode(to:).md)

### Type Methods

- [allOf(requirement:)](lightweightcoderequirements/launchcoderequirement/allof(requirement:).md)
- [anyOf(requirement:)](lightweightcoderequirements/launchcoderequirement/anyof(requirement:).md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Checking code requirements for launching processes

- [SecCodeCheckValidityWithProcessRequirement(code:flags:requirement:)](lightweightcoderequirements/seccodecheckvaliditywithprocessrequirement(code:flags:requirement:).md)
- [launchRequirement](foundation/process/launchrequirement.md)
- [allOf(requirement:)](lightweightcoderequirements/allof(requirement:)-4gf5f.md)
- [anyOf(requirement:)](lightweightcoderequirements/anyof(requirement:)-6nicx.md)
- [LaunchConstraint](lightweightcoderequirements/launchconstraint.md)
- [LaunchConstraintBuilder](lightweightcoderequirements/launchconstraintbuilder.md)
