如何在Firefox OS设备上调试javascript文件 [英] How to debug javascript file on Firefox OS device

查看:206
本文介绍了如何在Firefox OS设备上调试javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编辑Firefox OS设备的脚本文件。但是我不知道怎么做 ?当我使用控制台时没有编辑选项。所以我的问题是如何调试和编辑脚本文件?

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 ?

推荐答案

对于实时调试,你可以运行使用about: Firefox浏览器中的app-manager页面。您可以安装ADB(Android Debug Brdige)以将FirefoxOS设备与浏览器连接:

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

然后您可以使用ADB命令连接到您的设备:

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

连接后,应该能够将桌面Firefox浏览器中的app-manager与您的设备连接起来。然后,您可以运行要进行调试的应用程序。您可以获得检查器,控制台和调试器(Firefox开发工具),就像您获得的每个其他网站一样。

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.

当您需要保留更改时,需要在本地保存所需文件并使用adb pull / push to trasmit来自和返回设备的文件:

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

这篇关于如何在Firefox OS设备上调试javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆