How to add a packaged app to Firefox OS destop (desktop B2G)

删除回忆录丶 提交于 2019-12-13 06:58:57

问题


I'm developing an application for Firefox OS, and need to run Marionette tests (it is needed for my university thesis).

As I know there are two ways of doing this:

  • you have a Marionette enabled device
  • with B2G desktop

I don't have such a device so I tried the B2G desktop. Marionette is working fine, but I couldn’t find any resources that would explain me, how to add my own application to B2G desktop (it would be a packaged app).

Does anyone know how to do this?


回答1:


There's not an official documentation about how to push an app to Firefox OS Desktop. But you can do it manually at the moment you compile Gaia. Follow the steps from Building the B2G desktop client and at Downloading Gaia step you need to do:

Download Gaia for the first time, clone the source code repository on GitHub:

git clone https://github.com/mozilla-b2g/gaia
cd gaia

Or update an already existing clone of Gaia, you can pull in the latest changes from GitHub:

cd gaia
git pull

Now into the directory "apps/" create a new folder with the name of your app and inside of it put the content of your app. You will get a structure like this:

gaia/
- apps/
  - homescreen/
  - ...
  - ...
  - my-custom-app/
    - manifest.webapp
    - index.html
    - js/
    - ...
  - keyboard/
  - ...
- bin/
- build/
- ...

Of course, the folder for you custom app in this example is my-custom-app but you can use whatever name that you like.

Now follow the rest of the steps on the article and you will have your app pulled to the Firefox OS desktop ready to work.

I am not sure about this step, but I am remember that every time you change something on your app or you add a new app to the gaia/apps/ folder, you need to create the profile again every time you make a change and you like to see it live on the Desktop B2G. So, with this I am sure you can test and let me now if I am right.




回答2:


If I understand well, you want to deploy (install) your app from the desktop to the same desktop. Unfortunately it is not currently possible to just select your app and install it on desktop the same way you'd do it on a device or simulator. This issue is raised here :

https://ffdevtools.uservoice.com/forums/246087-firefox-developer-tools-ideas/suggestions/6344638-manage-firefox-on-desktop-the-same-way-as-firefoxo

I encourage anyone to vote for it if it'd be useful to you too.

However if you set up your own custom local server or host it on the web, then you can install your app on your desktop from it (basically your server would emulate a local "marketplace" or a local web site providing a web app).

UPDATE : Now the webIDE as a "Local Runtime" which might allow in the future to install, run and debug apps on Firefox for desktop the same way as on devices or simulators.



来源:https://stackoverflow.com/questions/26564378/how-to-add-a-packaged-app-to-firefox-os-destop-desktop-b2g

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!