iOS 6调试控制台消失了吗? [英] iOS 6 debug console gone?

查看:110
本文介绍了iOS 6调试控制台消失了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经使用移动Safari的调试控制台在我进行故障排除时打印出console.log消息。使用iOS 6,在Safari的高级设置中,Web Inspector取代了Debug Console。不幸的是,我的公司不允许我将我们正在测试的手机插入我们正在开发的计算机中。

I used to use the "Debug Console" for mobile Safari to print out console.log messages when I'm troubleshooting. With iOS 6, in Safari's advanced settings, the "Web Inspector" replaced the "Debug Console." Unfortunately, my company doesn't allow me to plug the phones we're testing with into the computers we're developing on.

有没有人知道如何启用使用console.log()打印的邮件在iOS 6的iPhone上显示?

Does anyone know how to enable messages printed by using console.log() to be show on iPhones with iOS 6?

推荐答案

我发现通过 window.onerror - >

I have found it helpful to output any JS errors with an alert on window.onerror ->

window.onerror = function(error) {
    alert(error);
};

我将其粘贴到脚本的顶部,以便在本机警报中输出任何运行时错误。也适用于桌面。

I paste that into the top of scripts so that any runtime errors will be output in a native alert. Works on desktop too.

这篇关于iOS 6调试控制台消失了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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