Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Brave browser for Android, iOS, Linux, macOS, Windows.

License

NotificationsYou must be signed in to change notification settings

brave/brave-browser

Repository files navigation

Brave Browser

Overview

This repository holds the build tools needed to build the Brave desktop browser for macOS, Windows, and Linux. In particular, it fetches and syncs code from the projects defined inpackage.json andsrc/brave/DEPS:

Downloads

You canvisit our website to get the latest stable release.

Contributing

Please see thecontributing guidelines.

OurWiki also has some useful technical information.

Community

Join the Q&A community if you'd like to get more involved with Brave. You canask for help,discuss features you'd like to see, and a lot more. We'd love to have your help so that we can continue improving Brave.

Help us translate Brave to your language by submitting translations athttps://explore.transifex.com/brave/brave_en/.

Follow@brave on X for important news and announcements.

Install prerequisites

Follow the instructions for your platform:

Clone and initialize the repo

Once you have the prerequisites installed, you can get the code and initialize the build environment.

git clone git@github.com:brave/brave-core.git path-to-your-project-folder/src/bravecd path-to-your-project-folder/src/bravenpm install# the Chromium source is downloaded, which has a large history (gigabytes of data)# this might take really long to finish depending on internet speednpm run init

brave-core based android builds should usenpm run init -- --target_os=android --target_arch=arm (or whichever CPU type you want to build for)brave-core based iOS builds should usenpm run init -- --target_os=ios

You can also set the target_os and target_arch for init and build using:

npm config set target_os androidnpm config set target_arch arm

Additional parameters needed to build are documented athttps://github.com/brave/brave-browser/wiki/Build-configuration

Internal developers can find more information athttps://github.com/brave/devops/wiki/%60.env%60-config-for-Brave-Developers

Build Brave

The default build type is component.

# start the component build compilenpm run build

To do a release build:

# start the release compilenpm run build Release

brave-core based android builds should usenpm run build -- --target_os=android --target_arch=arm or set the npm config variables as specified above forinit

brave-core based iOS builds should use the Xcode project found inios/brave-ios/App. You can open this project directly or runnpm run ios_bootstrap -- --open_xcodeproj to have it opened in Xcode. See theiOS Developer Environment for more information on iOS builds.

Build Configurations

Running a release build withnpm run build Release can be very slow and use a lot of RAM, especially on Linux with the Gold LLVM plugin.

To run a statically linked build (takes longer to build, but starts faster):

npm run build -- Static

To run a debug build (Component build with is_debug=true):

npm run build -- Debug

NOTE: the build will take a while to complete. Depending on your processor and memory, it could potentially take a few hours.

Run Brave

To start the build:

npm start [Release|Component|Static|Debug]

Update Brave

npm run sync -- [--force] [--init] [--create] [brave_core_ref]

This will attempt to stash your local changes in brave-core, but it's safer to commit local changes before running this

npm run sync will (depending on the below flags):

  1. 📥 Update sub-projects (chromium, brave-core) to latest commit of a git ref (e.g. tag or branch)
  2. 🤕 Apply patches
  3. 🔄 Update gclient DEPS dependencies
  4. ⏩ Run hooks (e.g. to performnpm install on child projects)
flagDescription
[no flags]updates chromium if needed and re-applies patches. If the chromium version did not change, it will only re-apply patches that have changed. Will update child dependenciesonly if any project needed updating during this script run.
**Use this if you want the script to manage keeping you up to date instead of pulling or switching branches manually. **
--forceupdates bothChromium andbrave-core to the latest remote commit for the current brave-core branch and theChromium ref specified in brave-browser/package.json (e.g.master or74.0.0.103). Will re-apply all patches. Will force update all child dependencies.
**Use this if you're having trouble and want to force the branches back to a known state. **
--initforce update bothChromium andbrave-core to the versions specified in brave-browser/package.json and force updates all dependent repos - same asnpm run init
--sync_chromium (true/false)Will force or skip the chromium version update when applicable. Useful if you want to avoid a minor update when not ready for the larger build time a chromium update may result in. A warning will be output about the current code state expecting a different chromium version. Your build may fail as a result.
-D, --delete_unused_depsWill delete from the working copy any dependencies that have been removed since the last sync. Mimicsgclient sync -D.

Runnpm run sync brave_core_ref to checkout the specifiedbrave-core ref and update all dependent repos including chromium if needed.

Scenarios

Create a new branch:

brave-browser>cd src/bravebrave-browser/src/brave> git checkout -b branch_name

Checkout an existing branch or tag:

brave-browser/src/brave> git fetch originbrave-browser/src/brave> git checkout [-b] branch_namebrave-browser/src/brave> npm run sync...Updating 2 patches......Updating child dependencies......Running hooks...

Update the current branch to the latest remote:

brave-browser/src/brave> git pullbrave-browser/src/brave> npm run sync...Updating 2 patches......Updating child dependencies......Running hooks...

Reset to latest brave-browser master and brave-core master (viainit, will always result in a longer build and will remove any pending changes in your brave-core working directory):

brave-browser> git checkout masterbrave-browser> git pullbrave-browser> npm run sync -- --init

When you know that DEPS didn't change, but .patch files did (quickest attempt to perform a mini-sync before a build):

brave-browser/src/brave> git checkout featureBbrave-browser/src/brave> git pullbrave-browser/src/brave>cd ../..brave-browser> npm run apply_patches...Applying 2 patches...

Enabling third-party APIs:

  1. Google Safe Browsing: Get an API key with SafeBrowsing API enabled fromhttps://console.developers.google.com/. Update theGOOGLE_API_KEY environment variable with your key as perhttps://www.chromium.org/developers/how-tos/api-keys to enable Google SafeBrowsing.

Development

Troubleshooting

SeeTroubleshooting for solutions to common problems.


[8]ページ先頭

©2009-2025 Movatter.jp