As Mozilla says that Firefox OS is purely hackable i.e. if you want to introduce any new feature in the Firefox OS or work on old to build it to better or just hack it and remix it. Many of you wondered how the hack it is possible and if it is possible then from where i can get started with it.
So folks, I am writing this post to somewhat address this issue though Mozilla already explained whole process on MDN but here i am going to explain it in is some different way, also i am assuming that initially you don’t have a device i.e. you are running gaia on simulator .
Before proceeding further it would be great if you mind few points:
- You should have previous knowledge how things with github works like fork, pull, push, merge blah blah.
- As far as i know you can not build gaia on Windows. So, “don’t try this in windows”
- Little bit of experience with command line (more preferably linux command line though if you have basic knowledge of windows command prompt, it will work)
- Make a fork of the main Gaia repo
- Clone your fork locally:
- Add upstream
git remote add upstream https://github.com/mozilla-b2g/gaia
- Now you need to create a Gaia profile. Running make inside your repo folder creates a profile in the profile directory, which is setup for optimal debugging. It creates unpackaged (hosted versions) of the Gaia apps that can be served directly via the local HTTPD server bundled along with Firefox desktop as an extension. When you make a change you just need to refresh your browser window to see the result (as you’ll see later), rather than having to rebuild the profile, repush it to the device, etc. This is really good for rapid CSS/JS/HTML hacking.
- To create gaia profile run this command
make PRODUCTION=1 DEVICE_DEBUG=1 MOZILLA_OFFICIAL=1 REMOTE_DEBUGGER=1 GAIA_KEYBOARD_LAYOUTS=en
- Now i would suggest you to download Mozilla central version of B2G desktop as i had already tried using web simulator and had some pretty bad experience so my recommendation would be to use B2G desktop version(We can launch it using pre loaded binary).
- Download tar file according to your OS architecture, like mine is ubuntu 32 bit so i am going with b2g-38.0a1.multi.linux-i686-localizer.tar.bz2
- Use this command to extract tar
tar -xvjf b2g-38.0a1.multi.linux-i686-localizer.tar.bz2
- Now you will see b2g named directory
- Move to b2g directory(cd b2g)
- Enter command ./b2g-bin -profile ‘profile path of your gaia directory’ like:
./b2g-bin -profile ‘/home/yaseen/gaia/profile’
- If all goes well you will see simulator running custom gaia 🙂
Summary of what i had tried to do here. We had downloaded gaia repo and created build profile. We had downloaded b2g and through b2g binary we are launching gaia profile.
I would like to Thanks Ahmed Nefzaoui for helping me out at every step.
Thanks for reading patiently .