Skip to content

Commit 7f0e6a9

Browse files
committed
Updated readme
1 parent a25d096 commit 7f0e6a9

2 files changed

Lines changed: 58 additions & 25 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ Thumbs.db
6161
typings/
6262
yarn-debug.log*
6363
yarn-error.log*
64-
TestProject/
64+
TestProject/
65+
.sot

README.md

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# AccessibilityDevTools
2-
A Swift Package Manager (SPM) command plugin that scans your iOS Swift codebase for accessibility issues using BrowserStack’s Accessibility DevTools rule engine.
2+
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.
33

4-
AccessibilityDevTools enables static accessibility linting directly inside Xcode via SwiftPM, helping teams catch WCAG violations early—before UI tests, QA, or production.
4+
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.
55

66
---
77
## 🚀 Key Capabilities
@@ -12,8 +12,8 @@ AccessibilityDevTools enables static accessibility linting directly inside Xcode
1212

1313
---
1414
## Supported projects types
15-
1. Projects created with XCode
16-
2. Projects created with Swift package manager
15+
1. Projects created with Swift package manager
16+
2. Projects created with XCode
1717

1818
---
1919
## Authentication
@@ -51,21 +51,18 @@ Run the following command at the **root of your repository**
5151

5252
Zsh
5353
```zsh
54-
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/zsh/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-zsh.sh
54+
curl -L -o browserstack-a11y-scan-spm-zsh.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/zsh/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-zsh.sh
5555
```
5656

5757
Bash
5858
```bash
59-
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/bash/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-bash.sh
59+
curl -L -o browserstack-a11y-scan-spm-bash.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/bash/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-bash.sh
6060
```
6161

6262
Fish
63-
```fish
64-
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-fish.sh
63+
```bash
64+
curl -L -o browserstack-a11y-scan-spm-fish.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/fish/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-fish.sh
6565
```
66-
#### Disable Sandboxing
67-
- In Xcode, select first item (project root) in the left folder tree and go to Build Settings tab
68-
- Search for `sandbox` > Set `User script sandboxing` to “NO”
6966

7067
#### Add a Build Phase
7168
Repeat these steps for each target in your project
@@ -75,10 +72,23 @@ Repeat these steps for each target in your project
7572
![Build Phase](./resources/build-phase.png "Build Phase")
7673
3. Drag this newly created build phase above **Compile Sources** step
7774
4. Delete any existing code in the newly created build step and add the following code
78-
5. Add this script:
75+
5. Add this script, depending upon the shell you picked earlier:
76+
77+
Zsh
78+
```zsh
79+
./browserstack-a11y-scan-spm-zsh.sh --include **/*.swift --non-strict
7980
```
80-
./browserstack-a11y-scan-spm.sh --include **/*.swift --non-strict
81+
82+
Bash
83+
```bash
84+
./browserstack-a11y-scan-spm-bash.sh --include **/*.swift --non-strict
85+
```
86+
87+
Fish
88+
```bash
89+
./browserstack-a11y-scan-spm-fish.sh --include **/*.swift --non-strict
8190
```
91+
8292
Xcode will now automatically run the accessibility scan during builds.
8393

8494
### 2. Projects created with Swift package manager
@@ -120,23 +130,19 @@ Run the following command at the **root of your repository**
120130

121131
Zsh
122132
```zsh
123-
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/zsh/spm.sh" && chmod 0775 browserstack-a11y-scan-spm.sh
133+
curl -L -o browserstack-a11y-scan-spm-zsh.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/zsh/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-zsh.sh
124134
```
125135

126136
Bash
127137
```bash
128-
curl -L -o browserstack-a11y-scan-spm.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/bash/spm.sh" && chmod 0775 browserstack-a11y-scan-spm.sh
138+
curl -L -o browserstack-a11y-scan-spm-bash.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/bash/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-bash.sh
129139
```
130140

131141
Fish
132-
```fish
133-
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
142+
```bash
143+
curl -L -o browserstack-a11y-scan-spm-fish.sh "https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/fish/spm.sh" && chmod 0775 browserstack-a11y-scan-spm-fish.sh
134144
```
135145

136-
#### Disable Sandboxing
137-
- In Xcode, select first item (project root) in the left folder tree and go to Build Settings tab
138-
- Search for `sandbox` > Set `User script sandboxing` to “NO”
139-
140146
#### Add a Build Phase
141147
Repeat these steps for each target in your project
142148

@@ -145,10 +151,23 @@ Repeat these steps for each target in your project
145151
![Build Phase](./resources/build-phase.png "Build Phase")
146152
3. Drag this newly created build phase above **Compile Sources** step
147153
4. Delete any existing code in the newly created build step and add the following code.
148-
5. Add this script:
154+
5. Add this script, depending upon the shell you picked earlier:
155+
156+
Zsh
157+
```zsh
158+
./browserstack-a11y-scan-spm-zsh.sh --include **/*.swift --non-strict
159+
```
160+
161+
Bash
162+
```bash
163+
./browserstack-a11y-scan-spm-bash.sh --include **/*.swift --non-strict
149164
```
150-
./browserstack-a11y-scan-spm.sh --include **/*.swift --non-strict
165+
166+
Fish
167+
```bash
168+
./browserstack-a11y-scan-spm-fish.sh --include **/*.swift --non-strict
151169
```
170+
152171
Xcode will now automatically run the accessibility scan during builds.
153172

154173
---
@@ -163,9 +182,22 @@ Press Cmd + B to build the project.
163182
---
164183
## Register pre-commit hook
165184
You can run accessibility checks automatically before each commit by running the following command.
185+
186+
Zsh
187+
```zsh
188+
./browserstack-a11y-scan-spm-zsh.sh register-pre-commit-hook
189+
```
190+
191+
Bash
166192
```bash
167-
./browserstack-a11y-scan-spm.sh register-pre-commit-hook
193+
./browserstack-a11y-scan-spm-bash.sh register-pre-commit-hook
168194
```
195+
196+
Fish
197+
```bash
198+
./browserstack-a11y-scan-spm-fish.sh register-pre-commit-hook
199+
```
200+
169201
You can then edit the `.git/hooks/pre-commit` file to customise the registered pre-commit hook.
170202

171203
---

0 commit comments

Comments
 (0)