Building Chromium for iOS

Chromium is an Google’s open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. Using chromium, you can build browser iOS app.

In this tutorial, I’m going to tell how to do checking out and building Chromium for iOS. It’s quite bit complicated 😟 when you see in the official site. I made it simple to play around.💪

Reference : https://chromium.googlesource.com/chromium/src/+/master/docs/ios/build_instructions.md#System-requirements

Prerequisites

  • You should have atleast 100 to 120 gb free space in your mac before getting into it. I’m suggesting you to have hard disk.
  • Fastest network connection (must)
  • You must have some patience to complete this task 😜

Open terminal → Folder → Paste this command

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Its take few seconds to complete and after that you will have depot_tools folder in your directory.

In the terminal,

vim .zshrc

Add depot_tools absolute path to .zshrc file and save it

export PATH="$PATH:/your path/depot_tools"

then again come to terminal and execute the command

source .zshrc

Open terminal → Folder → Paste this command

mkdir chromium && cd chromium

Now you are in the chromium folder. Following commands should be executed in this folder

Execute the following commands

1. pwd2. ../depot_tools/fetch iOS

Short commercial break ☕️

It takes minimum 1hr for fastest network and X hrs for slow network to complete. Let’s meet after that! 😅

It takes minimum 3 hrs! Please have patience. 😜

Once syncing done, you have chromium folder finally.

In the src folder, execute the following command. It takes a couple of minutes to generate out/build/all.xcodeproj.

ios/build/tools/setup-gn.py

Once you get the all.xcodeproj, you need to generate debug folder. To achieve this, run the below command from src folder. Here, I’m running the chromium project in simulator.

For simulator,autoninja -C out/Debug-iphonesimulator gn_allFor device,autoninja -C out/Debug-iphoneos gn_all

It will take 7 to 9 hrs to complete

Step9 : Open Xcode and Play around 🙌

Finally,

Step10 : Generating .ipa file

This is an additional step. This is not necessary for now. Once developing done, if you want archive the build run this command.

ninja -C out/Official-iphoneos chrome

It will take minimum 3 to 4hrs

Then,

$ mkdir temp$ mkdir temp/Payload$ cp out/Official-iphoneos/Chromium.app temp/Payload$ cd temp$ zip -r ../MyBrowser.zip .$ cd ..$ mv MyBrowser.zip MyBrowser.ipa

Now, you will have .ipa file under src folder.

I’m done with this. If you have doubts, please ping me here. 🍻

 iOS Developer @nfnlabs, Chennai. Here to share best practices learned through my experience. Reach me on https://www.linkedin.com/in/ashokkumar-b-26026913a/