Gaia/Hacking: Difference between revisions

Jump to navigation Jump to search
6,994 bytes removed ,  8 October 2012
no edit summary
m (use git:// for repo URLs (they are faster than HTTP))
No edit summary
Line 1: Line 1:
Inside Gaia everything is a Web Application, see {{MDN|Apps|Apps on MDN}}.
Gaia is the collection of [https://developer.mozilla.org/apps web apps] which make up the front end of [http://www.mozilla.org/firefoxos/ Firefox OS] (codenamed Boot to Gecko).


When Gaia starts, the homescreen application is the first application displayed on the screen.
Everything you see on the screen in Firefox OS is built using open web technologies, including the homescreen and dialer.


The homescreen application reads all installed web applications and shows an icon for each. This is done by using the window.navigator.mozApps object that exposes the Application Registry API [http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/apps/nsIDOMApplicationRegistry.idl].
== Running Gaia Apps ==


Quick start Instructions for running Gaia in a Nightly build
There are three ways to run Gaia apps:
* Firefox Nightly
* B2G Desktop
* B2G on a device


<pre class="_fck_mw_lspace">
=== Firefox Nightly ===
  # Install a nightly version of Firefox from http://nightly.mozilla.org/
Most Gaia apps will run in a nightly build of the Firefox web browser which you can download from [http://nightly.mozilla.org/ nightly.mozilla.org].


  # Clone the main gaia repository and generate a default set of apps/permissions
To help you get started running and hacking on Gaia apps, Gaia comes with a script to automatically generate a special Firefox profile which includes a simple web server.
  git clone git://github.com/mozilla-b2g/gaia.git gaia
  cd gaia
  DEBUG=1 make


  # Start Gaia by telling Nightly where is the profile generated
You can start by cloning [https://github.com/mozilla-b2g/gaia Gaia's git repository on Github], or by forking Gaia and cloning your fork.
  # IMPORTANT: Make sure all Firefox instances are closed before doing that.
  nightly -profile profile/ -no-remote http://system.gaiamobile.org:8080


  # Start making your changes!
$ git clone git://github.com/mozilla-b2g/gaia.git gaia
</pre>


Then to generate the Gaia profile:
  $ cd gaia
  $ DEBUG=1 make


If you want to go deeper, read the following instructions.
Then run Firefox Nightly from the command line, with the generated profile:


Gaia can be run in 3 different ways, each one requiring some specific steps to be set-up:
  $ /path/to/firefox -profile /path/to/gaia/profile


* inside a web browser such a Firefox
(substituting /path/to/firefox and /path/to/gaia for the paths you downloaded Firefox and cloned Gaia to, respectively)
* inside a device emulator
* on the device


Throughout these instructions the following is assumed:
'''Note:''' Unfortunately Gaia's system app (inside which the homescreen and other apps run) does not currently work in Firefox. Therefore you'll need to load an app directly by its URL, e.g. http://browser.gaiamobile.org:8080


GAIA = PATH_TO_GAIA_REPOSITORY
Running Gaia apps using this method has the advantage of giving you access to all the development tools built into Firefox. The disadvantage is that not all apps currently work in this way, and they may not behave ''exactly'' as they would on a device.
GAIA_DOMAIN = gaiamobile.org


=== B2G Desktop ===


== ATTENTION - Desktop builds now available ==
B2G Desktop is a desktop build of the B2G app runtime used on devices where all apps should run as they would on a device, including the homesreen.


There are now nightly builds of B2G desktop available here:
==== Nightly Builds ====


[http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/ http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/]
You can download a nightly build of B2G Desktop from [http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/ http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/] for Linux, OS X and Windows.


Please see [http://blog.mozilla.org/bhearsum/archives/320 this blog post] for the related announcement of these builds.  Using these builds only saves you from having to follow the steps in the [[Gaia/Hacking#Building_B2G|''Building B2G'']] section below. You still need to checkout Gaia in order to create a profile for running the desktop builds:
You still need to separately clone and "build" Gaia, in the same way as when using Firefox Nightly:
git clone git://github.com/mozilla-b2g/gaia
make -C gaia profile
/path/to/b2g -profile gaia/profile


From Ben's blog:
$ git clone git://github.com/mozilla-b2g/gaia.git gaia
$ cd gaia
$ DEBUG=1 make


<blockquote>'Please note that these are NOT full B2G builds. These are developer-targeted builds which only run on desktop machines, and cannot be flashed onto a phone or tablet. These builds are primarily useful to developers, QA and localizers working on Gaia. They can also be used by anyone who wishes to test out their websites or apps through a B2G-like client.. ''</blockquote>
Then you just run with B2G Desktop instead of Firefox:


'''As of July 13th, B2G Desktop Builds are working for Linux, Windows and OS X.'''
$ /path/to/b2g -profile /path/to/gaia/profile


An installer for windows that works out of the box is available from
(or "/path/to/b2g/B2G.app/Contents/MacOS/b2g -profile /path/to/gaia/profile" on OS X)
https://github.com/downloads/sihorton/b2g-desktop-profile-installer/b2g-gaia-desktop.exe


== Building B2G ==
To update gaia you run the following command inside the Gaia directory:
=== Pull the code ===
<pre class="_fck_mw_lspace"> hg clone http://hg.mozilla.org/mozilla-central src
If you encounter an 'Command not found hg' you need to install Mercurial: https://developer.mozilla.org/en/Installing_Mercurial
git clone git://github.com/mozilla-b2g/gaia.git gaia
</pre>
<h3> Update the code after the first time </h3>
<p>In the mozilla-central directory:
</p>
<pre class="_fck_mw_lspace">hg pull &amp;&amp; hg update
</pre>
<p> In the Gaia directory:
<pre class="_fck_mw_lspace">git fetch
git merge origin/master
</pre>
</p>


=== Create a mozconfig ===
$ git pull
<p>Create a file named "mozconfig" in the mozilla-central directory.
Here's an example mozconfig.
</p>
<pre class="_fck_mw_lspace">mk_add_options MOZ_OBJDIR=../build
mk_add_options MOZ_MAKE_FLAGS=&quot;-j9 -s&quot;


ac_add_options --enable-application=b2g
(or "git fetch && git merge upstream/master" if you checked out from your own clone).
ac_add_options --disable-libjpeg-turbo
# This option is required if you want to be able to run Gaia's tests
ac_add_options --enable-tests


# turn on mozTelephony/mozSms interfaces
==== Build Your Own ====
# Only turn this line on if you actually have a dev phone
# you want to forward to. If you get crashes at startup,
# make sure this line is commented.
#ac_add_options --enable-b2g-ril
</pre>
=== Build ===
<p>In the mozilla-central directory:
</p>
<pre class="_fck_mw_lspace">make -f client.mk build
</pre>
<p>The build will appear in ../build (or whatever MOZ_OBJDIR is set to in your mozconfig).
Be sure you're using python2 and not python3 as build will fail with python3.
</p>


== Running B2G ==
If you prefer you can build B2G Desktop yourself by checking it out from mozilla-central using Mercurial:


=== Desktop ===
$ hg clone http://hg.mozilla.org/mozilla-central src


The next steps will generate a profile that contains an Application cache version of Gaia and a pre-populated list of installed applications by mozApps.  
Before building, create a file called .mozconfig to configure some options, here's an example:
This profile will then be used by B2G to start the homescreen and populate it with apps.


  # generate the profile/ folder
  mk_add_options MOZ_OBJDIR=../build
  cd ${GAIA}
  mk_add_options MOZ_MAKE_FLAGS="-j9 -s"
make
   
   
  # Run b2g with the generated profile
ac_add_options --enable-application=b2g
  ../build/dist/bin/b2g -profile ${GAIA}/profile
ac_add_options --disable-libjpeg-turbo
 
  # This option is required if you want to be able to run Gaia's tests
ac_add_options --enable-tests
# turn on mozTelephony/mozSms interfaces
# Only turn this line on if you actually have a dev phone
  # you want to forward to. If you get crashes at startup,
# make sure this line is commented.
#ac_add_options --enable-b2g-ril


You may want to add the $MOZ_OBJDIR/dist/bin directory to your shell's $PATH and B2G_HOMESCREEN to your shell environment so you can just type "b2g" anywhere.
Then run make inside the mozilla-central directory:


==== Mac ====
$ make -f client.mk build


For Mac users, the simplest thing to do is cd to the gaia repo directory and run b2g directly:
'''Note:''' Ensure you're using python2 and not python3 as the build will fail with python3.


$ DEBUG=1 make && B2G.app/Contents/MacOS/b2g -profile `pwd`/profile
The build will appear in ../build (or whatever MOZ_OBJDIR is set to in your .mozconfig) and will take a ''long'' time the first time you build. Once it's built you can run B2G with:


In ./bin/b2g all the keyboard/mouse event will be redirect to Terminal for unknown reason.
$ ../build/dist/bin/b2g -profile /path/to/gaia/profile


As well, b2g seems to prefer an absolute path to the profile directory ( relative paths to the profile seem to work fine on Linux )
(substituting /path/to/gaia with the path to which you cloned Gaia).


==== Linux ====
When you want to update your own B2G Desktop build do:


Linux users can experience annoying rendering glitches. To avoid them, please add
$ hg pull && hg update


user_pref("layers.acceleration.disabled", true);
In the gaia directory:


to your ${GAIA}/profile/prefs.js file.
$ git pull


==== Windows ====
=== B2G on a device ===


For windows users a pre-built installer for b2g-desktop with pre-compiled gaia is available from
It is possible to build & run Firefox OS on a limited number of smartphones. Please see documentation [https://github.com/mozilla-b2g/B2G/blob/master/README.md here].


https://github.com/downloads/sihorton/b2g-desktop-profile-installer/b2g-gaia-desktop.exe
== Unit Tests ==


a portable version (that extracts to a directory and does not create start menu entries) is also available:
Gaia comes with a suite of unit tests, which you can run using the built-in Test Agent app (by running it in B2G desktop, B2G on a device, or by navigating to http://test-agent.gaiamobile.org:8080 in Firefox Nightly).


https://github.com/downloads/sihorton/b2g-desktop-profile-installer/b2g-portable.exe
See [https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests here] for more information on writing and running unit tests for Gaia.


If you want to update the included b2g-desktop to a newer version available from http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central/ then extract the downloaded zip into the b2g-gaia-desktop directory the installer created for you.
== Contributing Code ==


== Running tests ==
Mozilla depends on contributions from the open source community to help develop Gaia apps and we'd love you to get invovled.
There is a dedicated test framework for B2G called [https://developer.mozilla.org/en/Marionette Marionette]. You can set up Marionette with [https://developer.mozilla.org/en/Marionette/Setup#Running_Marionette_on_Desktop_Firefox_or_B2G_Desktop_builds B2G Desktop] or for [https://developer.mozilla.org/en/Marionette/Setup#Running_B2G_and_Marionette_on_an_emulator_or_device an emulator or device].


=== Unit tests ===
Some great places to find some bugs to start hacking on:
See https://developer.mozilla.org/en-US/docs/Mozilla/Boot_to_Gecko/Gaia_Unit_Tests
* [https://bugzilla.mozilla.org/buglist.cgi?quicksearch=component:gaia%20sw:polish%20@nobody;list_id=4566236 Unowned Gaia polish bugs on Bugzilla]
* [http://www.joshmatthews.net/bugsahoy/?b2g=1 Mentored bugs]


== Loading Gaia from a server ==
To submit a patch:
* Assign an un-owned Gaia bug to yourself on [https://bugzilla.mozilla.org/buglist.cgi?product=Boot2Gecko&component=Gaia&resolution=--- Bugzilla]
* Fork Gaia on Github
* Develop in a branch on your fork (remembering to keep to the [https://wiki.mozilla.org/Gaia#Coding_Style Coding Style guidelines] for Gaia)
* Push to your branch
* Send a pull request
* Paste a link to the pull request in the bug on Bugzilla
* Your patch will be reviewed on Github
* To make changes in response to the code review, just push more commits to the same branch and your pull request will get updated automatically
* Once the reviewer is happy with your patch, they will merge it into the master branch for you


=== Desktop ===
== Contacting The Team ==
For development you might find it helpful to load Gaia from a web server instead of relying on the application cache.
* [https://lists.mozilla.org/listinfo/dev-gaia Gaia Mailing List]
* #gaia IRC channel on irc.mozilla.org


First you need to generate a profile that does not rely on the Application Cache. From your Gaia directory run:
DEBUG=1 make
The generated profile directory also contains a web server. When you run B2G desktop using this profile the web server will run on port 8080...
b2g -profile /path/to/gaia/profile/directory
<!--
HIDE THIS PART -- bug has landed
Currently you also need to map all the subdomains to localhost to get B2G to load gaiamobile.org from your own machine.
Note: This will not be needed any more once {{bug|722197}} is fixed.
Edit '''/etc/hosts''' (or [http://en.wikipedia.org/wiki/Hosts_%28file%29#Location_in_the_file_system somewhere else] on other systems) and add the following lines
127.0.0.1    gaiamobile.org
127.0.0.1    homescreen.gaiamobile.org
127.0.0.1    dialer.gaiamobile.org
127.0.0.1    sms.gaiamobile.org
127.0.0.1    browser.gaiamobile.org
127.0.0.1    maps.gaiamobile.org
127.0.0.1    camera.gaiamobile.org
127.0.0.1    gallery.gaiamobile.org
127.0.0.1    video.gaiamobile.org
127.0.0.1    market.gaiamobile.org
127.0.0.1    music.gaiamobile.org
127.0.0.1    settings.gaiamobile.org
127.0.0.1    clock.gaiamobile.org
127.0.0.1    crystalskull.gaiamobile.org
127.0.0.1    penguinpop.gaiamobile.org
127.0.0.1    towerjelly.gaiamobile.org
127.0.0.1    wikipedia.gaiamobile.org
127.0.0.1    cnn.gaiamobile.org
127.0.0.1    bbc.gaiamobile.org
127.0.0.1    nytimes.gaiamobile.org
127.0.0.1    calculator.gaiamobile.org
127.0.0.1    system.gaiamobile.org
([http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/ OSX has issues with single lines with multiple domains])
-->
=== Device ===
Pull the hosts file from the device
$ adb pull /system/etc/hosts
add the line to the hosts file
192.168.1.3    gaiamobile.org dialer.gaiamobile.org sms.gaiamobile.org browser.gaiamobile.org maps.gaiamobile.org camera.gaiamobile.org gallery.gaiamobile.org video.gaiamobile.org market.gaiamobile.org music.gaiamobile.org settings.gaiamobile.org clock.gaiamobile.org crystalskull.gaiamobile.org penguinpop.gaiamobile.org towerjelly.gaiamobile.org wikipedia.gaiamobile.org cnn.gaiamobile.org bbc.gaiamobile.org nytimes.gaiamobile.org calculator.gaiamobile.org
(where 192.168.1.3 is the static IP of your development box on your network)
Push the hosts file back to the device
adb push hosts /system/etc/hosts
Reboot the device and if Wifi is configured it should load the homescreen from your desktop machine!


== Tips ==
== Tips ==
=== Rendering glitches on Linux ===
If you're running on Linux and find you're seeing lots of annoying rendering glitches, try turning off layer acceleration with a pref in your gaia/profile/prefs.js file:


=== Using a different domain ===
  user_pref("layers.acceleration.disabled", true);
You can easily use a different domain when using Gaia:
 
  GAIA_DOMAIN=mydomain.org make


=== Port Forwarding ===
=== Port Forwarding ===
To forward the socket on the phone to the desktop (for desktop development), you first need to get rilproxy to expose it as such, rather than exposing it to Gecko. In the gaia directory:
To forward the socket on the phone to the desktop (for desktop development), you first need to get rilproxy to expose it as such, rather than exposing it to Gecko. In the gaia directory:


make forward
  $ make forward


This runs the commands:
This runs the commands:  
 
  $ adb shell touch /data/local/rilproxyd
  adb shell touch /data/local/rilproxyd
  $ adb shell killall rilproxy
  adb shell killall rilproxy
  $ adb forward tcp:6200 localreserved:rilproxyd
  adb forward tcp:6200 localreserved:rilproxyd


The file located at /data/local/rilproxyd will be deleted once the rilproxy daemon will start again. As a consequence you have to do this manipulation every time your device restarts.
The file located at /data/local/rilproxyd will be deleted once the rilproxy daemon will start again. As a consequence you have to do this manipulation every time your device restarts.


=== Restarting the b2g application ===
=== Restarting B2G on a device from the desktop ===
To reload/restart b2g everything simply enter the command:
  adb shell killall b2g
  adb shell killall b2g


=== Using Firefox instead of B2G to launch Gaia ===
=== B2G Desktop JavaScript Console ===
While the b2g build has more features than Firefox you can use try to use Firefox to develop if you don't need the additional features offered by the b2g build (Please note that these features will land in Firefox too one day). Instead of using b2g on the command line to launch Gaia, just use firefox:
 
firefox -profile ${GAIA_DIR} -no-remote http://homescreen.gaiamobile.org:8080
 
''Note: this will work with the port specification assuming you have run <code>DEBUG=1 make</code>''


=== Javascript Console ===
You can run B2G Desktop with the JavaScript console by using the -jsconsole flag
You can open the Javascript Console by running:
../build/dist/bin/b2g -jsconsole


=== Launching an App Directly ===
=== Launching an app directly ===


A "--runapp" option has been added to the b2g-desktop command-line to automatically start an application. The system app is loaded and everything happens like normal; this is not like the old trick where we loaded your app instead of the system app.
A "--runapp" option has been added to the B2G Desktop command-line to automatically start an application. The system app is loaded and everything happens like normal; this is not like the old trick where we loaded your app instead of the system app.


"--runapp" takes an argument that it normalizes by lower-casing and removing dashes and spaces, and then checks the argument against the similarly normalized app names from app manifests. For example, the name of the e-mail app is currently "E-Mail", but "--runapp email" will run it. Partial matching is not supported right now, but you can enhance b2g/chrome/content/runapp.js if your app name is unwieldy.
"--runapp" takes an argument that it normalizes by lower-casing and removing dashes and spaces, and then checks the argument against the similarly normalized app names from app manifests. For example, the name of the e-mail app is currently "E-Mail", but "--runapp email" will run it. Partial matching is not supported right now, but you can enhance b2g/chrome/content/runapp.js if your app name is unwieldy.


If you invoke "--runapp" without an argument (or an empty argument), the command will print out a list of all the apps it knows about as well as a brief usage message.
If you invoke "--runapp" without an argument (or an empty argument), the command will print out a list of all the apps it knows about as well as a brief usage message.


One important note is that this command disables the lock-screen as part of its magic and does not re-enable it. The assumption is that you won't use this command on a profile where you are testing the lock screen, or will turn it back on manually. Feel free to enhance the command to behave better if this is a problem for you.
One important note is that this command disables the lock-screen as part of its magic and does not re-enable it. The assumption is that you won't use this command on a profile where you are testing the lock screen, or will turn it back on manually. Feel free to enhance the command to behave better if this is a problem for you.
 
'''In summary:'''
 
  ./b2g -profile /path/to/your/gaia/profile --runapp email
 
runs the e-mail app.
 
=== Touch events ===
To enable the necessary interfaces in the Firefox web browser you need to go to about:config and add the boolean preference '''dom.w3c_touch_events.enabled''' and set it to '''true'''.
 
=== Hosting Gaia using Apache ===
 
As an alternative to B2G's own web server, you may find it helpful to host Gaia apps using your own Apache web server. Below is a quick guide on how to set that up, this is based on Ubuntu but should work on other platforms with a few modifications.
 
If you haven't already installed Apache, you should install it
$ sudo apt-get install apache2
 
Enable virtual hosts by changing the first two lines of /etc/apache2/sites-available/default to:
 
NameVirtualHost *
<VirtualHost *>
 
(Note that the first line is new, the second line should replace the first line in the default version of that file)
 
Create a virtual host config at /etc/apache2/sites-available/gaiamobile.org
 
# Redirect [browser|sms|...].gaiamobile.org to ${GAIA}/apps/[browser|sms|...]/.
<VirtualHost *>
  ServerName  homescreen.gaiamobile.org
  ServerAlias *.gaiamobile.org
  VirtualDocumentRoot /path/to/gaia/apps/%1/
</VirtualHost>
<VirtualHost *>
  ServerName gaiamobile.org
  ServerAlias gaiamobile.org
  DocumentRoot /path/to/gaia
</VirtualHost>
# Add the correct mimetypes for offline cache manifest
AddType text/cache-manifest .appcache
# Prevent Apache from caching apps files
<IfModule mod_expires.c>
  ExpiresActive on
  ExpiresDefault "access plus 0 hours"
  ExpiresByType text/html "access plus 0 hours"
  ExpiresByType text/xml "access plus 0 hours"
  ExpiresByType text/css "access plus 0 hours"
  ExpiresByType text/plain "access plus 0 hours"
  ExpiresByType application/x-javascript "access plus 0 hours"
  ExpiresByType application/javascript "access plus 0 hours"
  ExpiresByType text/javascript "access plus 0 hours"
  ExpiresByType text/cache-manifest "access plus 0 hours"
  ExpiresByType image/gif "access plus 0 hours"
  ExpiresByType image/png "access plus 0 hours"
  ExpiresByType image/jpeg "access plus 0 hours"
  ExpiresByType image/x-icon "access plus 0 hours"
</IfModule>
 
Enable the Apache modules
$ sudo a2enmod expires
$ sudo a2enmod vhost_alias
 
Enable the gaiamobile.org virtual host
$ sudo a2ensite gaiamobile.org
 
Restart Apache
$ sudo apache2ctl graceful
 
=== IPv6 ===
 
IPv6 can cause occasional slowdowns when running from a web server, you can fix this by disabling it in the user preferences
 
    content += 'user_pref("network.dns.disableIPv6", true);\n';


=== Disabling updates ===
In summary:


In {{bug|744989}}, Fabrice points out that you can disable gaia updates from gaiamobile.org by using the following commands:
./b2g -profile /path/to/your/gaia/profile --runapp email


$ cd $GAIA
runs the e-mail app.  
$ GAIA_DOMAIN=foo.org make install-gaia
$ adb push profile/user.js /data/b2g/mozilla/$$PROFILE_DIR$$/user.js


This is useful if one wants to, for example, do some sort of analysis on a particular build.
=== reset-gaia and install-gaia make targets ===


=== "reset-gaia" and "install-gaia" make targets ===
The reset-gaia and install-gaia make targets can be used interchangeably. reset-gaia will purge all the existing profiles, database before push Gaia from your working directory (new setting database will also be initialized); install-gaia will just push updates of Gaia.


The <code>reset-gaia</code> and <code>install-gaia</code> make targets can be used interchangeably. <code>reset-gaia</code> will purge all the existing profiles, database before push Gaia from your working directory (new setting database will also be initialized); <code>install-gaia</code> will just push updates of Gaia.
=== Blank screen when B2G Desktop starts ===
When you start b2g using b2g -profile $GAIA/profile a blank screen shows up and you see an error Cannot reach app://system.gaiamobile.org. To fix this there are a couple of things you can check


=== Blank screen when b2g starts ===
* Rebuild the gaia profile using DEBUG=1 make profile in the $GAIA directory
When you start b2g using <code>b2g -profile $GAIA/profile</code> a blank screen shows up and you see an error <code>Cannot reach app://system.gaiamobile.org</code>. To fix this there are a couple of things you can check
* Run b2g again
# Rebuild the gaia profile using <code>DEBUG=1 make profile</code> in the $GAIA directory
* If this doesn't fix it, check if there is any other process listening on port 8080. The default profile of gaia starts httpd.js, which listens on port 8080. When running a debug profile, b2g connects to localhost:8080. If some other process is running on port 8080, b2g will fail to display the home screen of gaia
# Run b2g again
** To find out if this is the case, you can enable logging on httpd.js. The httpd.js in the profile resides in this location - $GAIA/profile/extensions/httpd/content/httpd.js. Edit the variable var DEBUG=false; to change the DEBUG to true. Save the file and restart b2g. On the console now, you will be able to view the httpd's logs
# If this doesn't fix it, check if there is any other process listening on port 8080. The default profile of gaia starts [https://developer.mozilla.org/en-US/docs/Httpd.js/HTTP_server_for_unit_tests httpd.js], which listens on port 8080. When running a debug profile, b2g connects to [http://localhost:8080 localhost:8080]. If some other process is running on port 8080, b2g will fail to display the home screen of gaia
## To find out if this is the case, you can enable logging on httpd.js. The httpd.js in the profile resides in this location - <code>$GAIA/profile/extensions/httpd/content/httpd.js</code>. Edit the variable <code>var DEBUG=false;</code> to change the <code>DEBUG</code> to <code>true</code>. Save the file and restart b2g. On the console now, you will be able to view the <code>httpd's</code> logs
Confirmed users
394

edits

Navigation menu