Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AccessibilityDevTools
A Swift Package Manager (SPM) command plugin and CLI tool that scans your iOS Swift codebase for accessibility issues using BrowserStack’s Accessibility DevTools rule engine.
A Swift Package Manager (SPM) command plugin that scans your iOS Swift codebase for accessibility issues using BrowserStack’s Accessibility DevTools rule engine.

AccessibilityDevTools enables static accessibility linting directly inside Xcode, via SwiftPM, or using the standalone BrowserStack CLI, helping teams catch WCAG violations early—before UI tests, QA, or production.
AccessibilityDevTools enables static accessibility linting directly inside Xcode via SwiftPM, helping teams catch WCAG violations early—before UI tests, QA, or production.

---
## 🚀 Key Capabilities
Expand All @@ -12,8 +12,8 @@ AccessibilityDevTools enables static accessibility linting directly inside Xcode

---
## Supported projects types
1. Projects created with Swift package manager
2. Projects created with XCode
1. Projects created with XCode
2. Projects created with Swift package manager

---
## Authentication
Expand All @@ -27,13 +27,13 @@ AccessibilityDevTools enables static accessibility linting directly inside Xcode
4. To set these variables, add the appropriate export commands to your shell configuration file:
* **Zsh**: Add the following lines to your `~/.zshrc` file:
```zsh
export BROWSERSTACK_USERNAME="<your-username>"
export BROWSERSTACK_ACCESS_KEY="<your-access-key>"
export BROWSERSTACK_USERNAME=<your-username>
export BROWSERSTACK_ACCESS_KEY=<your-access-key>
```
* **Bash**: Add the following lines to your `~/.bashrc` or `~/.bash_profile` file:
```bash
export BROWSERSTACK_USERNAME="<your-username>"
export BROWSERSTACK_ACCESS_KEY="<your-access-key>"
export BROWSERSTACK_USERNAME=<your-username>
export BROWSERSTACK_ACCESS_KEY=<your-access-key>
```
* **Fish Shell**: Add the following lines to your ~/.config/fish/config.fish file:
```fish
Expand All @@ -44,10 +44,10 @@ AccessibilityDevTools enables static accessibility linting directly inside Xcode
---
## Installation
### 1. Projects created with XCode
> Note: XCode projects don’t have a Package.swift file. However, the script will manage this for you. If you prefer not to do this or face any issues, you can use our CLI for linting instead.
> Note: XCode projects don’t have a `Package.swift` file. However, the script will manage this for you. If you prefer not to do this or face any issues, you can use our [CLI](https://www.browserstack.com/docs/accessibility-dev-tools/xcode-linter#CLI) for linting instead.

#### Clone Script
Run the following command at the <span style="color:red">root of your repository</span>
Run the following command at the **root of your repository**

Zsh
```zsh
Expand All @@ -63,6 +63,9 @@ Fish
```fish
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/fish/spm.sh" && chmod 0775 browserstack-a11y-scan-spm.sh
```
#### Disable Sandboxing
- In Xcode, select first item (project root) in the left folder tree and go to Build Settings tab
- Search for `sandbox` > Set `User script sandboxing` to “NO”

#### Add a Build Phase
Repeat these steps for each target in your project
Expand All @@ -71,7 +74,7 @@ Repeat these steps for each target in your project
2. Click + to create a new build phase. Name the newly created build phase to a name such as **BrowserStack Accessibility Linter**.
![Build Phase](./resources/build-phase.png "Build Phase")
3. Drag this newly created build phase above **Compile Sources** step
4. Delete any existing code in the newly created build step and add the following code.
4. Delete any existing code in the newly created build step and add the following code
5. Add this script:
```
./browserstack-a11y-scan-spm.sh --include **/*.swift --non-strict
Expand Down Expand Up @@ -113,7 +116,7 @@ let package = Package(
```

#### Clone Script
Run the following command in the <span style="color:red;">root of your repository</span>
Run the following command at the **root of your repository**

Zsh
```zsh
Expand All @@ -130,11 +133,15 @@ Fish
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/fish/spm.sh" && chmod 0775 browserstack-a11y-scan-spm.sh
```

#### Disable Sandboxing
- In Xcode, select first item (project root) in the left folder tree and go to Build Settings tab
- Search for `sandbox` > Set `User script sandboxing` to “NO”

#### Add a Build Phase
Repeat these steps for each target in your project

1. Select a target from the targets left sidebar and go to Build Phases tab
2. Click + to create a new build phase. Name the newly created build phase to a name such as **BrowserStack Accessibility Linter**
2. Click + to create a new build phase. Name the newly created build phase to a name such as **BrowserStack Accessibility Linter**.
![Build Phase](./resources/build-phase.png "Build Phase")
3. Drag this newly created build phase above **Compile Sources** step
4. Delete any existing code in the newly created build step and add the following code.
Expand Down