How to debug Worklight iOS app or phonegap iOS app - ios

I have read these article
http://moduscreate.com/enable-remote-web-inspector-in-ios-6/
http://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/
but i cant to able to see my app under
Develop-->Device name-->myApp.
But i could able to debug blank safari browser.Could anyone suggest how to debug the iOS app in chrome or safari? Whether i have to change any app setting like in android android-debuggable:true?

Worklight is not based on Telerik, so following their tutorials is kinda moot.
If you have an application running in a device and you would like to debug is using the Inspector tool that Apple's Safari browser provides, follow these steps:
Make sure that the application you've installed on the device was built to the device from Xcode, and is not from a production build (i.e. the App Store) - otherwise it will not be available in the Safari Inspector. Also that it is connected via USB to the Mac...
Make sure you have enable the Inspector tool. In Safari > Preferences > Advanced > tick the checkbox for "Show Develop menu in menu bar"
Now that 1 & 2 have been verified, go to Safari > Develop > your-device > your-app

Related

How do I make web inspector work iOS 13.3.1 and Safari 13.0.5 or Safari Technology Preview 13.2?

I am connecting my iPhone 5 SE with an Apple OEM lighting-to-thunderbolt cable. I have the latest version of macOS (10.15.3) installed.
I have made sure that the Web Inspector setting in Settings > Safari > Advanced is turned on.
On both Safari and Safari Technology Preview I have enabled the Develop menu. My device does not show up in either.
I tried removing trusted devices from my iPhone by resetting my location and privacy in General > Reset. I then re-added my macOS system as a trusted device. This did not help either.
Any thoughts?
I am using OSX 10.15.3, (non-preview) Safari 13.0.5 and an iPhone 7 (A1660) running iOS 13.3. I plugged the phone into the Mac for the first time and trusted the computer. The Web Inspector and Remote Automation settings are available on the phone. Desktop Safari is able to find the phone in its Develop tab. It is possible to debug web pages or progressive web apps saved to the home screen, when one or both of Web Inspect and Remote Automation are enabled on the phone. Even if the debugger is not enabled, desktop Safari still knows the phone is there but shows No Inspectable Applications.
Try setting up WiFi sync for the phone, and connecting it with the cable.
I am using this tool- Safari Technology Preview to debug my iphone on mac.
Download link- https://developer.apple.com/safari/technology-preview/

Debugging HTML in iOS webview

Android can use desktop Chrome's web inspector to debug HTML/CSS issues embedded in an App's WebView, as long as you connect them through USB.
I've been searching all over google and this site and cannot find any information regarding this. Is there a similar way to inspect HTML/CSS elements/rules in iOS?
Because there are some issues that only affects webview, so viewing it from iOS Safari cannot reproduce some issues.
You can do this using Safari on Mac.
First, go to settings on iPhone → Safari → Advanced. Then enable the "Web Inspector" option and follow the instructions to enable on Mac.
Edit: this will only work with apps installed using Xcode.

phonegap app extremely slow to load website on ios

I have a phonegap app that opens a website using window.open(). While it works fine in testing, when I compile the app and install it on an iPhone using TestFlight it can take anywhere from 1 minute to 15 minutes to open the website. When it does everything works fine. The app store review is rejecting it because of the delay. What can I check to identify the cause of this delay?
Use remote debugging with an iOS device (or a simulator). This will allow you to see error's log like debugging a web site.
See "Safari in iOS" in : https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/GettingStarted/GettingStarted.html
Open the Settings app.
Tap Safari.
Scroll down and select Advanced.
Switch Web Inspector to ON.
After Web Inspector is enabled, connect your device to your desktop machine with a USB cable. The name of your device appears in the Develop menu of Safari.
Also, depending of what you want to do, I suggest you, instead of using window.open, to use the cordova-plugin-inappbrowser plugin to open link in the browser (outside the webview of Cordova/Phonegap)

Phonegap iOS Safari debug workflow

I've been testing out Phonegap Build, using a similar workflow as outlined here:
Tutorial: Developing a PhoneGap Application
I can build, and deploy to my devices, but cannot get remote debugging to work through Safari, as described in the answer here:
Could you tell be debug process in Phonegap iOS application?
I have no problems debugging the app through the mobile browser, but the installed app itself does not show up in Safari's develop menu.
I am transferring my app to my phone through xCode, and have enabled debugging in the Phonegap build interface, but the Weinre debug service seems to be down. Ideally I'd like to get this working through Safari, could anyone share their debug workflow?
thanks
When you say "native app", you actually mean the Phonegap app deployed to your device?
Here is how I do it. It works on both iOS Simulator and actual device:
Open Settings > Safari > Advanced and make sure "Web Inspector" is enabled
Connect the device and deploy the Phonegap app using Xcode
Wait for the app to launch and navigate to Safari on my desktop, then find my device name in the develop menu
Make sure Web Inspector is enabled in Settings > Safari > Advanced > WebInspector.

Using the Network Link Conditioner on iOS devices

How can I simulate various network conditions directly on my iOS device? I know this is possible on a Mac thanks to the Network Link Conditioner. Is there something similar on iOS devices?
Yes, with iOS 6, it is now possible to use the Network Link Conditioner directly on your iOS device, if your device is set to be enabled for development.
Simply go to Settings > Developer > Network Link Conditioner to enable it.
If you don't see Settings > Developer, to enable it:
Connect your iPhone to your Mac.
Xcode > Organizer
Select your iPhone.
Click Use for Development.
I've noticed that sometimes the Developer menu item disappears. It reappears again when installing an app using Xcode.
Might also mention that the developer option doesn't show up in settings sometimes until you tether the device and launch Xcode.
Close Settings>tether device>launch Xcode> Open Settings
So strange thing happened for me and hopefully it'll save someone the hassle.
I had my phone set to developer mode as I've used to build multiple apps previously.
For some reason, searching "Network Link Conditioner" in Settings doesn't bring up anything. Searching "Developer" brings up the Apple Developer app (if you have it installed) that shows info about WWDC videos, news etc. about Apple development.
For a little while I thought my phone wasn't in developer mode but scrolling thru Settings to see the other "Developer" option for actual developer settings of the device, its still there.
As an update for iOS8, and for people confused about the next step, if you have already gotten to the step in which you deploy to your device, all you need to do is go to on the device > Settings > Developer > Network Link Conditioner.

Resources