Current release version is built from https://github.com/cliqz/user-agent-ios
Download on the App Store.
This branch is for mainline development.
- Install the latest Xcode developer tools from Apple.
- Install Carthage
brew update
brew install carthage
- Clone the repository:
git clone https://github.com/mozilla/firefox-ios
- Pull in the project dependencies:
cd browser-ios
sh ./bootstrap.sh
- Get dependencies for react-native:
npm install
pod install
- Build react-native bundle
npm run dev-bundle
- Open
Client.xcodeproj
in Xcode. - Build the
Fennec
scheme in Xcode.
It is possible to use App Code instead of Xcode, but you will still require the Xcode developer tools.
This branch uses react-native for background javascript. The bootstrap setup will automatically setup the react-native environment, and create a XCode workspace which you should use to open the project.
You can enable extra debug tools for React by passing a DEBUG
flag to the react module:
- In the
Pods.xcodeproj
go to build settings - Under
Preprocessor Macros
add aDEBUG=1
option for theFennec
build. - Now React debug options will be available after a 'shake' gesture in the app.
By default React uses the jsengine.bundle.js
code bundle to run. In order to develop you can use the react-native command line tools to auto re-generate this bundle when you change the code.
- Start react-native dev server
npm run dev-server
-
Configure react to use the debug server: in
Client.xcodeproj
under build settings, go to 'Other Swift Flags' and add-DReact_Debug
to theFennec
flags. -
Now the app will load code provided by the bundler when starting.
-
Checkout a copy of browser-core (Cliqzers, use navigation-extension for non-release versions).
-
Get browser-core dependencies::
cd /path/to/browser-core
./fern.js install
- Build browser-core with the
react-native.json
config, and output to node_modules forbrowser-ios
:
CLIQZ_OUTPUT_PATH=/path/to/browser-ios/node_modules/browser-core/build/ ./fern.js serve configs/react-native.json
With this workflow, any code changes will be automatically rebuild, then you can reload the js bundle in the app (running in the emulator) to see the changes.
The Cliqz extension modules are exposed to debuggers via the app
global variable. You can use this as an entry point to inspect the state of the app.
You can create a new js bundle using the react-native cli:
npm run dev-bundle
- Swift code should generally follow the conventions listed at https://github.com/raywenderlich/swift-style-guide.
- Exception: we use 4-space indentation instead of 2.
- New code should not contain any trailing whitespace.
- We recommend enabling both the "Automatically trim trailing whitespace" and "Including whitespace-only lines" preferences in Xcode (under Text Editing).
git rebase --whitespace=fix
can also be used to remove whitespace from your commits before issuing a pull request.
- Each commit should have a single clear purpose. If a commit contains multiple unrelated changes, those changes should be split into separate commits.
- If a commit requires another commit to build properly, those commits should be squashed.
- Follow-up commits for any review comments should be squashed. Do not include "Fixed PR comments", merge commits, or other "temporary" commits in pull requests.