I'm developing a JavaScript application that needs to run on the Google Android Phone OS. Is there a way to enable the JavaScript Error/Debug console within Safari on either the Android Emulator or an actual device? If so any instructions on how to do so would be appreciated.
相关问题
- Is there a limit to how many levels you can nest i
- How can I create this custom Bottom Navigation on
- How to toggle on Order in ReactJS
- Bottom Navigation View gets Shrink Down
- void before promise syntax
You can view the log and much more with weinre
From the Weinre docs
A quick Google turns up this blog post (posted after you asked your question), that should at least let you see any Javascript errors via the Android Debug Bridge using the command:
Not quite the same as a full debug console though.
On Android write about:debug on the address line when the current page is the page you want to debug. you will get access to the console.
I know your question is about Safari, but you might want to look into using Chrome instead. You can now use Chrome's desktop developer tools to debug and profile apps on your Android device.
Here's how:
adb forward tcp:9222 localabstract:chrome_devtools_remote
You should see a list of the pages you have open on your phone. Click the one you want to debug/profile.
Detailed instructions are here
It looks like, with the Android 2.0.1 SDK you'll need to filter on "browser" instead of "WebCore"
I have discovered that you can get this debugging information on the phone itself, without needingn to use adb or plug it into a computer, just download a log viewer.
Check the link for more info.