javascript Firebug 喜欢在 Android 上调试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15861331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Firebug like debugging on Android
提问by akc42
I have seen several posts that talk about remote debugging of javascript code on Android, but they all miss the point of what I am trying to do.
我看过几篇关于在 Android 上远程调试 javascript 代码的帖子,但他们都没有抓住我想要做的事情的重点。
I have a Nexus 7 and I want to use it as a remote development environment when I am away from my desktop. I have created a chrooted debian distribution to run apache and php and git (via ssh). This chrooted environment mounts a subdirectory of the /sdcard directory from outside the chroot environement. Apache document root of a virtual host is pointing at a directory within this. Before leaving the desktop I can git push the latest release to the tablet. When I return git pull can get what I have done back again.
我有一台 Nexus 7,我想在离开桌面时将其用作远程开发环境。我创建了一个 chrooted debian 发行版来运行 apache、php 和 git(通过 ssh)。这个 chroot 环境从 chroot 环境外部挂载 /sdcard 目录的子目录。一个虚拟主机的Apache 文档根目录指向其中的一个目录。在离开桌面之前,我可以 git push 最新版本到平板电脑。当我返回 git pull 时,可以再次返回我所做的事情。
I then (when away from home and NOT connected to any network) can edit the code using an Android editor (using the 920 text editor), but then run the browser to look at what I have developed using localhost the apache virtual host picks this up and displays it.
然后我(离开家并且未连接到任何网络时)可以使用 Android 编辑器(使用 920 文本编辑器)编辑代码,但是然后运行浏览器查看我使用 localhost 开发的内容,apache 虚拟主机选择了这个并显示出来。
The application I am developing IS NOT FOR ANDROID - it is ultimately for the desktop. But I want to be able to debug it like I was on the desktop. Breakpoints and single stepping are the prime thing, but also I tend to use the html section in firebug to adjust my CSS before editing it.
我正在开发的应用程序不适用于 ANDROID - 它最终适用于桌面。但我希望能够像在桌面上一样调试它。断点和单步执行是最重要的,但我也倾向于在编辑之前使用 firebug 中的 html 部分来调整我的 CSS。
Is there a way to get either the chrome developer tools or firebug add on for firefox to load into a browser that will run in android?
有没有办法让 chrome 开发人员工具或 firebug 添加到 Firefox 中以加载到将在 android 中运行的浏览器?
采纳答案by Irvin Dominin
I use Firebug lite bookmarklet for iPhone and iPad, never tried on Android, check this out http://martinkool.com/post/13629963755/firebug-on-ipad-and-iphoneit must be similar on Android.
我在 iPhone 和 iPad 上使用 Firebug lite 书签,从未在 Android 上尝试过,请查看http://martinkool.com/post/13629963755/firebug-on-ipad-and-iphone它在 Android 上必须类似。
To activate it use this steps:
要激活它,请使用以下步骤:
- Create a new bookmark or bookmark a page
- Rename the bookmark to “Firebug”
- Copy the textarea link:
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?Fi+'NS':Fi;Er;Er;Er;(Fe[0]||Fe[0]).appendChild(E);E=new%20Image;Er;})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
- Edit the Firebug bookmarklet, remove the URL and paste the bookmarklet
- Choose “Done” (on the virtual keyboard) and you're all set
- 创建新书签或为页面添加书签
- 将书签重命名为“Firebug”
- 复制文本区域链接:
javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F. documentElement.namespaceURI;E=E?Fi+'NS':Fi;Er;Er;Er;(Fe[0]||Fe[0]).appendChild(E);E=new%20Image;Er;})( document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases/lite/latest/skin/xp/sprite.png','https://getfirebug.com/','#startOpened');
- 编辑 Firebug 书签,删除 URL 并粘贴书签
- 选择“完成”(在虚拟键盘上)就完成了
回答by ZER0
At least not for Firefox Mobile, because all the devtools are still partially based on XUL, where the Firefox Mobile is using Native UI.
至少不适用于 Firefox Mobile,因为所有的开发工具仍然部分基于XUL,其中 Firefox Mobile 使用的是 Native UI。
I don't think there is any plan in the close future to change this situation; it's not a common scenario.
我不认为在不久的将来有任何计划来改变这种情况。这不是一个常见的场景。
However, you should be able to do something using the Debugger API, creating an add-on for Firefox Mobile. But I don't know if it's worthy.
但是,您应该能够使用Debugger API做一些事情,为 Firefox Mobile 创建一个附加组件。但不知道值不值得。