diff --git a/README.md b/README.md index ec819c3..259661c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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="" - export BROWSERSTACK_ACCESS_KEY="" + export BROWSERSTACK_USERNAME= + export BROWSERSTACK_ACCESS_KEY= ``` * **Bash**: Add the following lines to your `~/.bashrc` or `~/.bash_profile` file: ```bash - export BROWSERSTACK_USERNAME="" - export BROWSERSTACK_ACCESS_KEY="" + export BROWSERSTACK_USERNAME= + export BROWSERSTACK_ACCESS_KEY= ``` * **Fish Shell**: Add the following lines to your ~/.config/fish/config.fish file: ```fish @@ -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 root of your repository +Run the following command at the **root of your repository** Zsh ```zsh @@ -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 @@ -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 @@ -113,7 +116,7 @@ let package = Package( ``` #### Clone Script -Run the following command in the root of your repository +Run the following command at the **root of your repository** Zsh ```zsh @@ -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.