|
| 1 | +# Platform-Specific Build & Troubleshooting Tips |
| 2 | + |
| 3 | +This document provides platform-specific build instructions, troubleshooting steps, and local development tips for integrating and working with Content Scope Scripts (C-S-S) across iOS, macOS, Android, Windows, and browser extensions. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## iOS/macOS |
| 8 | + |
| 9 | +- **Check Xcode Version:** |
| 10 | + - [.xcode-version](https://github.com/duckduckgo/apple-browsers/tree/main/.xcode-version) |
| 11 | +- **Set up C-S-S or Autofill as a Local Dependency:** |
| 12 | + - Drag the folder from Finder into the directory panel in Xcode. |
| 13 | +- **Privacy Config Files:** |
| 14 | + - Both apps bundle a privacy config file: [macos-config.json](https://github.com/duckduckgo/apple-browsers/blob/main/macOS/DuckDuckGo/ContentBlocker/macos-config.json) & [ios-config.json](https://github.com/duckduckgo/apple-browsers/blob/main/iOS/Core/ios-config.json). |
| 15 | + - To test privacy config changes, update this file as well as the config endpoint for remote updates ([macOS](https://github.com/duckduckgo/apple-browsers/blob/main/macOS/DuckDuckGo/Application/AppConfigurationURLProvider.swift#L60) & [iOS](https://github.com/duckduckgo/apple-browsers/blob/main/iOS/Core/AppURLs.swift#L49)). |
| 16 | +- **If you receive errors related to packages:** |
| 17 | + - File > Packages > Reset Package Caches |
| 18 | + - Clean Project with `cmd+K` |
| 19 | + - Delete all files inside `~/Library/Developer/Xcode/DerivedData` |
| 20 | + - If none of that works, ask for help in the [Apple Devs Mattermost channel](https://chat.duckduckgo.com/ddg/channels/devs). |
| 21 | + |
| 22 | +## Android |
| 23 | + |
| 24 | +- [Override the Privacy Remote Config](https://app.asana.com/1/137249556945/project/1202561462274611/task/1203855276415003?focus=true) |
| 25 | + - Ensure the config version is higher than the current version (the app may refuse to update otherwise). |
| 26 | +- **Clean Project:** |
| 27 | + - Build → 'Clean Project' (clears cache of potentially stale C-S-S file). |
| 28 | + - Uninstall the app from the emulator as well. |
| 29 | +- **Linking Local Dependencies:** |
| 30 | + - Use `npm link @duckduckgo/content-scope-scripts` or `npm link @duckduckgo/autofill` to link to your local checkout. |
| 31 | + - In that directory, also run `npm link` in the dependency folder. |
| 32 | + - This symlinks to your local dir and acts as if you're pointing to your PR. |
| 33 | + - Run `npm build` in C-S-S (not run automatically like in the extension). |
| 34 | +- **Alternative Android Setup (more reliable):** |
| 35 | + - Alter the path of the resources in the appropriate module's `build.gradle` to an absolute path on your machine. |
| 36 | + - Example: [build.gradle gist](https://gist.github.com/shakyShane/0b133a0782bdb37c876c4a4204667bb2) |
| 37 | + - After making this change, click 'sync now' when Gradle prompts. |
| 38 | + - All changes in C-S-S will be picked up every time you restart the app. |
| 39 | + - This works for all JS dependencies (Autofill, Dashboard, C-S-S, etc). |
| 40 | + |
| 41 | +## Windows |
| 42 | + |
| 43 | +- [Work with content-scope-scripts repo on Windows](./development-utilities.md#windows-development) |
| 44 | +- [Debugging `autofill.js` (or other submodules) on Windows](https://app.asana.com/1/137249556945/project/1198964220583541/task/1208938714611510) |
| 45 | + |
| 46 | +## Extensions |
| 47 | + |
| 48 | +- Use npm link as per Android. |
| 49 | +- See the [other development steps](https://github.com/duckduckgo/duckduckgo-privacy-extension/blob/main/CONTRIBUTING.md#building-the-extension). |
0 commit comments