orvi
orvi

Reputation: 3340

How to debug javascript file on Firefox OS device

I want to edit a script file of Firefox OS device. But I do not know how ? When I use the console There's no option for editing . SO my question is how can I debug and edit the script file ?

Upvotes: 1

Views: 596

Answers (3)

matths
matths

Reputation: 960

For live debugging, you can run use the about:app-manager page inside the Firefox browser. You can install the ADB (Android Debug Brdige) to connect the FirefoxOS device with the Browser:

// install ADB

// Linux
apt-get install android-tools-adb

// OSX
brew install android-platform-tools

Then you can connect to your device using ADB commands:

// connect to your device / change IP
adb connect 192.168.1.5

// connect as root
adb root

// get a shell to your device, Ctrl-D will quit
adb shell

// enable port forwarding to use app-manager in your Desktop Firefox browser
adb forward tcp:6000 localfilesystem:/data/local/debugger-socket // or ADB Helper

// get the log output
adb logcat

When connected you, should be able connect the app-manager with your device inside your Desktop Firefox browser. Then you can run the App you want to live debug. You get an inspector, console and debugger (Firefox dev tools) just like you would get for every other website.

see all installed apps

dev tools

When you need to persist the changes, you need to save the desired files locally and use adb pull/push to trasmit the files from and back to the devicce:

adb pull /system/b2g/webapps/browser.gaiamobile.org/application.zip
adb push application.zip /system/b2g/webapps/browser.gaiamobile.org/application.zip

Upvotes: 1

akshayx11
akshayx11

Reputation: 41

You may download Firefox Developer edition browser for your desktop/pc then go to webIDE from the setting and download simulator of the Firefox OS.Go to webIDE, you can choose the any downloaded app in the simulator for the debug.

To download Firefox developer edition browser go to : https://www.mozilla.org/en-US/firefox/channel/#aurora

Upvotes: 1

Jason Weathersby
Jason Weathersby

Reputation: 1081

Currently you can debug certified apps on the phone if you have enabled DevTools restricted privileges using the toolbar menu Runtime->Runtime Info when you are connected to the device. You can not edit the JavaScript files though. In order to do this, you need to check out Gaia and flash it to your phone. You could also probably use adb pull/push to replace the current system apps as well. If you want to checkout Gaia see this page: https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia source for the apps is here: https://github.com/mozilla-b2g/gaia/tree/master/apps

Upvotes: 0

Related Questions