体验B2G(Firefox OS) Desktop版

Firefox OS的桌面日常构建版已经开放下载3个月了,每天都有新的版本被上传到这个FTP上.

在我写这篇文章的时候,最新的版本是这个:

把这个文件解压:

然后需要下载并编译gaia:

$ git clone git://github.com/mozilla-b2g/gaia
$ make -C gaia profile

别小看这两条命令,它们都很要命.

执行结束后我们会得到一个1.4GB的gaia文件夹.

最后运行b2g:

$ /path/to/b2g -profile gaia/profile

出现了上图这样很cool的界面,说明Firefox OS成功运行了.

以下是三条命令刷出来的命令行信息:

blackglory@blackglory--PC:~$ git clone git://github.com/mozilla-b2g/gaia  
Cloning into 'gaia'...  
remote: Counting objects: 86145, done.  
remote: Compressing objects: 100% (25304/25304), done.  
remote: Total 86145 (delta 60473), reused 83676 (delta 58471)  
Receiving objects: 100% (86145/86145), 250.83 MiB | 503 KiB/s, done.  
Resolving deltas: 100% (60473/60473), done.  
Checking out files: 100% (2274/2274), done.  
blackglory@blackglory--PC:~$ make -C gaia profile  
make:进入目录'/home/blackglory/gaia'  
rm -rf xulrunner-sdk  
wget -c http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/09/2012-09-20-03-05-43-mozilla-central/xulrunner-18.0a1.en-US.linux-i686.sdk.tar.bz2  
--2012-10-27 19:15:06--  http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/09/2012-09-20-03-05-43-mozilla-central/xulrunner-18.0a1.en-US.linux-i686.sdk.tar.bz2
Resolving ftp.mozilla.org (ftp.mozilla.org)... 63.245.215.46  
Connecting to ftp.mozilla.org (ftp.mozilla.org)|63.245.215.46|:80... connected.  
HTTP request sent, awaiting response... 200 OK  
Length: 395401499 (377M) [application/x-bzip2]  
Saving to: `xulrunner-18.0a1.en-US.linux-i686.sdk.tar.bz2'

100%[=====================================>] 395,401,499  416K/s   in 15m 48s 

2012-10-27 19:30:55 (407 KB/s) - `xulrunner-18.0a1.en-US.linux-i686.sdk.tar.bz2' saved [395401499/395401499]

tar xjf xulrunner*.tar.bz2 && rm xulrunner*.tar.bz2  
Generating application data...  
test -d profile || mkdir -p profile  
run-js-command  applications-data  
Done. If this results in an error remove the xulrunner/xulrunner-sdk folder in your gaia folder.  
Generating prefs.js...  
test -d profile || mkdir -p profile  
run-js-command  preferences

user_pref("browser.manifestURL", "app://system.gaiamobile.org/manifest.webapp");  
user_pref("browser.homescreenURL", "app://system.gaiamobile.org/index.html");  
user_pref("dom.send_after_paint_to_content", true);  
user_pref("network.http.max-connections-per-server", 15);  
user_pref("network.dns.localDomains", "gaiamobile.org,communications.gaiamobile.org,costcontrol.gaiamobile.org,browser.gaiamobile.org,camera.gaiamobile.org,system.gaiamobile.org,video.gaiamobile.org,wallpaper.gaiamobile.org,email.gaiamobile.org,homescreen.gaiamobile.org,fm.gaiamobile.org,settings.gaiamobile.org,music.gaiamobile.org,feedback.gaiamobile.org,clock.gaiamobile.org,calculator.gaiamobile.org,gallery.gaiamobile.org,sms.gaiamobile.org,calendar.gaiamobile.org,pdfjs.gaiamobile.org,keyboard.gaiamobile.org,uitest.gaiamobile.org,test-receiver-inline.gaiamobile.org,test-receiver-2.gaiamobile.org,template.gaiamobile.org,share-receiver.gaiamobile.org,geoloc.gaiamobile.org,test-agent.gaiamobile.org,test-receiver-1.gaiamobile.org,image-uploader.gaiamobile.org,test-sensors.gaiamobile.org,penguinpop.gaiamobile.org,cubevid.gaiamobile.org,tasks.gaiamobile.org,crystalskull.gaiamobile.org,towerjelly.gaiamobile.org");  
if [ -f custom-prefs.js ]; \  
      then \
        cat custom-prefs.js >> profile/user.js; \
      fi
if [ -f build/payment-prefs.js ]; \  
        then \
            cat build/payment-prefs.js >> profile/user.js; \
        fi
Done  
for d in apps test_apps showcase_apps; \  
    do \
        for mfile in `find $d -mindepth 2 -maxdepth 2 -name "Makefile"` ;\
        do \
            make -C `dirname $mfile`; \
        done; \
    done;
make[1]: Entering directory `/home/blackglory/gaia/apps/calendar'

make[1]: Leaving directory `/home/blackglory/gaia/apps/calendar'  
for d in `find -L apps test_apps showcase_apps -mindepth 1 -maxdepth 1 -type d` ;\  
    do \
          mkdir -p $d/test/unit ; \
          mkdir -p $d/test/integration ; \
            cp -f test_apps/test-agent/common/test/boilerplate/_proxy.html $d/test/unit/_proxy.html; \
            cp -f test_apps/test-agent/common/test/boilerplate/_sandbox.html $d/test/unit/_sandbox.html; \
    done
Done bootstrapping test proxies/sandboxes  
# Build json array of all test files
for d in apps test_apps showcase_apps; \  
    do \
        find $d -name '*_test.js' | sed "s:$d/::g"  >> /tmp/test-agent-config; \
    done;
Built test ui config file: ./test_apps/test-agent/config.json  
Generated webapps  
run-js-command  webapp-manifests  
{
  "communications.gaiamobile.org": {
    "origin": "app://communications.gaiamobile.org",
    "installOrigin": "app://communications.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://communications.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 1
  },
  "costcontrol.gaiamobile.org": {
    "origin": "app://costcontrol.gaiamobile.org",
    "installOrigin": "app://costcontrol.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://costcontrol.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 2
  },
  "browser.gaiamobile.org": {
    "origin": "app://browser.gaiamobile.org",
    "installOrigin": "app://browser.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://browser.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 3
  },
  "camera.gaiamobile.org": {
    "origin": "app://camera.gaiamobile.org",
    "installOrigin": "app://camera.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://camera.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 4
  },
  "system.gaiamobile.org": {
    "origin": "app://system.gaiamobile.org",
    "installOrigin": "app://system.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://system.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 5
  },
  "video.gaiamobile.org": {
    "origin": "app://video.gaiamobile.org",
    "installOrigin": "app://video.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://video.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 6
  },
  "wallpaper.gaiamobile.org": {
    "origin": "app://wallpaper.gaiamobile.org",
    "installOrigin": "app://wallpaper.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://wallpaper.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 7
  },
  "email.gaiamobile.org": {
    "origin": "app://email.gaiamobile.org",
    "installOrigin": "app://email.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://email.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 8
  },
  "homescreen.gaiamobile.org": {
    "origin": "app://homescreen.gaiamobile.org",
    "installOrigin": "app://homescreen.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://homescreen.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 9
  },
  "fm.gaiamobile.org": {
    "origin": "app://fm.gaiamobile.org",
    "installOrigin": "app://fm.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://fm.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 10
  },
  "settings.gaiamobile.org": {
    "origin": "app://settings.gaiamobile.org",
    "installOrigin": "app://settings.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://settings.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 11
  },
  "music.gaiamobile.org": {
    "origin": "app://music.gaiamobile.org",
    "installOrigin": "app://music.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://music.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 12
  },
  "feedback.gaiamobile.org": {
    "origin": "app://feedback.gaiamobile.org",
    "installOrigin": "app://feedback.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://feedback.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 13
  },
  "clock.gaiamobile.org": {
    "origin": "app://clock.gaiamobile.org",
    "installOrigin": "app://clock.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://clock.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 14
  },
  "calculator.gaiamobile.org": {
    "origin": "app://calculator.gaiamobile.org",
    "installOrigin": "app://calculator.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://calculator.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 15
  },
  "gallery.gaiamobile.org": {
    "origin": "app://gallery.gaiamobile.org",
    "installOrigin": "app://gallery.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://gallery.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 16
  },
  "sms.gaiamobile.org": {
    "origin": "app://sms.gaiamobile.org",
    "installOrigin": "app://sms.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://sms.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 17
  },
  "calendar.gaiamobile.org": {
    "origin": "app://calendar.gaiamobile.org",
    "installOrigin": "app://calendar.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://calendar.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 18
  },
  "pdfjs.gaiamobile.org": {
    "origin": "app://pdfjs.gaiamobile.org",
    "installOrigin": "app://pdfjs.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://pdfjs.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 19
  },
  "keyboard.gaiamobile.org": {
    "origin": "app://keyboard.gaiamobile.org",
    "installOrigin": "app://keyboard.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://keyboard.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 20
  },
  "uitest.gaiamobile.org": {
    "origin": "app://uitest.gaiamobile.org",
    "installOrigin": "app://uitest.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://uitest.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 21
  },
  "test-receiver-inline.gaiamobile.org": {
    "origin": "app://test-receiver-inline.gaiamobile.org",
    "installOrigin": "app://test-receiver-inline.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://test-receiver-inline.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 22
  },
  "test-receiver-2.gaiamobile.org": {
    "origin": "app://test-receiver-2.gaiamobile.org",
    "installOrigin": "app://test-receiver-2.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://test-receiver-2.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 23
  },
  "template.gaiamobile.org": {
    "origin": "app://template.gaiamobile.org",
    "installOrigin": "app://template.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://template.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 24
  },
  "share-receiver.gaiamobile.org": {
    "origin": "app://share-receiver.gaiamobile.org",
    "installOrigin": "app://share-receiver.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://share-receiver.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 25
  },
  "geoloc.gaiamobile.org": {
    "origin": "app://geoloc.gaiamobile.org",
    "installOrigin": "app://geoloc.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://geoloc.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 26
  },
  "test-agent.gaiamobile.org": {
    "origin": "app://test-agent.gaiamobile.org",
    "installOrigin": "app://test-agent.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://test-agent.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 27
  },
  "test-receiver-1.gaiamobile.org": {
    "origin": "app://test-receiver-1.gaiamobile.org",
    "installOrigin": "app://test-receiver-1.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://test-receiver-1.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 28
  },
  "image-uploader.gaiamobile.org": {
    "origin": "app://image-uploader.gaiamobile.org",
    "installOrigin": "app://image-uploader.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://image-uploader.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 29
  },
  "test-sensors.gaiamobile.org": {
    "origin": "app://test-sensors.gaiamobile.org",
    "installOrigin": "app://test-sensors.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://test-sensors.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 30
  },
  "penguinpop.gaiamobile.org": {
    "origin": "app://penguinpop.gaiamobile.org",
    "installOrigin": "app://penguinpop.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://penguinpop.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 31
  },
  "cubevid.gaiamobile.org": {
    "origin": "app://cubevid.gaiamobile.org",
    "installOrigin": "app://cubevid.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://cubevid.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 32
  },
  "tasks.gaiamobile.org": {
    "origin": "app://tasks.gaiamobile.org",
    "installOrigin": "app://tasks.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://tasks.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 33
  },
  "crystalskull.gaiamobile.org": {
    "origin": "app://crystalskull.gaiamobile.org",
    "installOrigin": "app://crystalskull.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://crystalskull.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 34
  },
  "towerjelly.gaiamobile.org": {
    "origin": "app://towerjelly.gaiamobile.org",
    "installOrigin": "app://towerjelly.gaiamobile.org",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "app://towerjelly.gaiamobile.org/manifest.webapp",
    "appStatus": 3,
    "localId": 35
  },
  "maps": {
    "origin": "http://demo.maps.public.devbln.europe.nokia.com/repository/ffos_buildme_k_b/",
    "installOrigin": "http://demo.maps.public.devbln.europe.nokia.com/repository/ffos_buildme_k_b/",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "http://demo.maps.public.devbln.europe.nokia.com/repository/ffos_buildme_k_b/manifest.webapp",
    "localId": 36
  },
  "marketplace-staging": {
    "origin": "https://marketplace.allizom.org/telefonica/",
    "installOrigin": "https://marketplace.allizom.org/telefonica/",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "https://marketplace.allizom.org/telefonica/manifest.webapp",
    "localId": 37
  },
  "marketplace": {
    "origin": "https://marketplace.mozilla.org/telefonica/",
    "installOrigin": "https://marketplace.mozilla.org/telefonica/",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "https://marketplace.mozilla.org/telefonica/manifest.webapp",
    "localId": 38
  },
  "marketplace-dev": {
    "origin": "https://marketplace-dev.allizom.org/telefonica/",
    "installOrigin": "https://marketplace-dev.allizom.org/telefonica/",
    "receipt": null,
    "installTime": 132333986000,
    "manifestURL": "https://marketplace-dev.allizom.org/telefonica/manifest.webapp",
    "localId": 39
  }
}
Done  
(if [ -d ./.git ]; then \
      git log -1 --format="%H%n%at" HEAD > apps/settings/resources/gaia_commit.txt; \
    else \
      echo 'Unknown Git commit; build date shown here.' > apps/settings/resources/gaia_commit.txt; \
      date +%s >> apps/settings/resources/gaia_commit.txt; \
    fi)
Packaged webapps  
run-js-command  webapp-zip  
Done  
Generating extensions...  
Done  
cp build/settings.json profile/settings.json  
Profile Ready: please run [b2g|firefox] -profile /home/blackglory/gaia/profile  
make:离开目录“/home/blackglory/gaia”  
blackglory@blackglory--PC:~$ sudo b2g/b2g -profile gaia/profile  
Starting b2g-bin  
Running: /home/blackglory/b2g/b2g-bin -profile /home/blackglory/b2g/gaia/profile  
Fontconfig warning: "/etc/fonts/conf.d/99-language-selector-zh.conf", line 11: Having multiple values in <test> isn't supported and may not works as expected  
Opened socket on 9999  
[AccessFu] INFO attach
###################################### forms.js loaded
XXX FIXME : Got a mozContentEvent: system-message-listener-ready  
XXX FIXME : Got a mozContentEvent: accessibility-screenreader  
###################################### forms.js loaded
###################################### forms.js loaded
###################################### forms.js loaded
###################################### forms.js loaded
XXX FIXME : Got a mozContentEvent: activity-choice  
creating 1!  
Fontconfig warning: "/etc/fonts/conf.d/99-language-selector-zh.conf", line 11: Having multiple values in <test> isn't supported and may not works as expected  
[TabChild] SHOW (w,h)= (0, 0)
creating 1!  
Fontconfig warning: "/etc/fonts/conf.d/99-language-selector-zh.conf", line 11: Having multiple values in <test> isn't supported and may not works as expected  
###################################### forms.js loaded
###################################### forms.js loaded
loading app://homescreen.gaiamobile.org/index.html, 1