How to debug app in Ipad? - javascript

I’ve created an app and installed it on my iPad. Unfortunately part of the functionality is not working: when I press a certain button, it should execute some JS code, but this is not the case. In the tool which I use for creating it, there’s no bug, no exception, nothing that leads to an error. This is the same in Chrome using the Developer Tools.
Since the tool allows me to generate the file for Android, I installed the app in my Samsung Galaxy SII and Nexus 7. It works perfectly there!
I think it must be a problem with PhoneGap. Is there any tool for debugging the app on the iPad (not within Xcode)?

If relevant logs are being generated, it is possible to connect the device to a Mac and see the general console, where you'll see these logs (amongst many other system related events)

I downloaded and installed Safari for Windows and found the bug. Unfortunately there´s no version 6 for Windows so that I can use the newest developer tools.

Related

React Native behavior different in simulator / on device / with or without Chrome debugging

I'm building a React Native app (currently iOS only) and I found a very nasty bug that only manifests itself when 1.) running on a real device, and 2.) running without Chrome debugging. (Ouch, right?)
I'm using react-native-router-flux with tabs and when I tap on a button that loads a new tab route (Actions.tabRouteName), the screen goes blank. As I said, it works fine in the simulator, and also, on the device when I enable Chrome debugging.
Other things I tried: running on another device, reloading JS, rebuilding app in Xcode.
Any reason the behavior would be different in these different run cases?
Thank you.
Update: This appears to have something to do with animations and route switching. I posted more details in this Github issue. I also found anecdotal support for the idea that other people are encountering similar issues with debugging in this Github issue.
Any reason the behavior would be different in these different run cases?
It's because when you use remote debugging in Chrome, it practically runs the RN app in the browser (it then uses the V8 JavaScript engine) and communicates with the simulator (or device) through WebSockets. When it runs without remote debugging enabled, it uses JavaScript Core. There are many differences between these environments and these can cause inconsistencies, so don't rely much on running your app only with JS debugging enabled, it can give you false errors or hide errors that would actually cause problems on a real device.

JavaScript console library

I have heard about a JavaScript library that simulates the console from development tools, but I can't find anything on the web.
My need is when I deploy my HTML5 + JavaScript application (with Icenium) in a device (tablet or smartphone and Android or iOS). Sometimes some bugs only occurs on those devices and not in my desktop's simulator, so a console running on it will be very helpful.
Are you looking for something like jqconsole?
Not JavaScript tools for emulating the console, but here are some other ways around it:
Chrome for Android has remote debugging through Chrome for Desktop
And I think Safari has a similar feature for iOS devices.

How to debug web app on windows mobile (7 and later) [duplicate]

I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582

Is it possible with Weinre to set javascript breakpoints when debugging iOS webviews

I'm using weinre to debug a phonegap application. However it doesn't seem possible to step through the JS or set breakpoints. Is this at all possible?
No, it is not possible to set breakpoints with weinre.
No is the correct answer. And the "secret XCode UIWebView" mentioned in the other answer doesn't work any more. BUT ...
You can now throw the Weinre out the window because, with the release of iOS 6, Apple released remote mobile Web Inspector for Safari, and this is HUGE for anyone who's been struggling to debug their iOS mobile apps. Basically you have all the features and power of regular Safari Web Inspector--including Breakpoints--for your mobile apps, including WebView & Phonegap apps. I've used weinre quite a bit, and this makes it completely obsolete for these purposes, since the new remote Web Inspector is a full-featured, native debugger.
Here's how it works (requires a Mac, xCode 4.5+ running an iOS 6 simulator (or an attached iOS 6 device, I think), and Safari 6+ on your Mac:
In your ios6 simulator/device, Settings --> Safari --> Advanced --> Web Inspector --> On (this is On by default in the simulator).
In Safari, access iPhone/iPad Simulator from the Develop menu and see your page. You can enable the Develop menu in Safari's Advanced Preferences if you don't see it.
More discussion at the bottom of: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
even if this an old question, maybe someone is still struggling with iOS debugging from windows (as i was until today...:D).
I found this quite good solution:
https://www.genuitec.com/products/gapdebug/
You can install apps from ipa and debug all the code usually obfuscated by Safari.

How to install google chrome on android 3.0 emulator?

Well from last couple of weeks I am developing an application using html, javascript on android emulator3.0
which I am running on my desktop(Windows XP).To run my programs I use webkit browser which I think default one for the android emulator and it is showing many problems to support HTML and Javascript objects and properties.
So I was assuming that may be if I install google chrome on the emulator then it can give me a desktop like behavior on the emulator.May be my assumption is wrong.i am very new in this field.
So anyone have any idea that whether it is possible or not?If it is possible then how I can do this.
Thanks in advance!!!!!
Regards,
Arvind Thakur
Google chrome is not available for Android (at least yet) link
Maybe you can try to install Firefox or Opera, both of them should have a version for Android
There is article on How to get Google Play, that would let to install other apps, including Google Chrome for Android
Installing Google Play on Android Emulator May 2nd, 2012
http://piotrbuda.eu/2012/05/installing-google-play-on-android-emulator.html

Categories

Resources