Applies to Kony Visualizer Classic.
Kony Visualizer provides you with a debugger to detect and diagnose errors in your applications.
From V8 SP4 onwards, you can debug apps in Kony Visualizer.
The debugger allows you to control the execution of your application by:
The debugger has a client and server design. This design allows you to debug applications that are running remotely on the network as well as the applications running locally on your workstation.
Debugging an application involves building the application in debug mode (iOS or Android) and launching the application in an iOS or Android emulator or device. You can then use the Google Chrome debugger to debug the application. For information on using the Chrome debugger, see Get Started with Debugging JavaScript in Chrome DevTools on the Google Chrome website.
See the following for information on debugging an application:
You must build and debug an iOS app in the Mac environment.
To build and launch an iOS application for debugging, do the following:
To build and launch an Android application for debugging, do the following:
With Kony Visualizer, you can perform JavaScript debugging on connected Apple computers and devices. This procedure assumes that you have the Google Chrome web browser installed on your computer. You also need to install and run on your Mac the iOS WebKit Debug Proxy (ios_webkit_debug_proxy). It must be version 1.6 or greater. To install this utility, from your Mac, open a terminal and enter the following command:
brew install ios-webkit-debug-proxy
Important: You can debug JavaScript applications in iOS using the Kony Visualizer preview app on your device or on the simulator. The option to debug applications in iOS is available from Preview > Debug in Kony Visualizer Enterprise.
Important: If you are using a Windows machine to connect to a Mac machine for debugging, for iOS applications Functional Preview debugging, a URL will be generated in the console of Kony Visualizer. Ensure that you copy and paste the generated URL in your Chrome browser to start the debugging process.
Important: Ensure that you deactivate and activate the breakpoint once your debugging starts in your Chrome browser. This is applicable for Windows and Mac machines.
To debug JavaScript applications for iOS on a simulator or device:
You can then use the Google Chrome debugger to debug the application. For information on using the Chrome debugger, see Get Started with Debugging JavaScript in Chrome DevTools on the Google Chrome website.
Kony Visualizer supports JavaScript debugging for iOS native applications with Safari web browser and Web Inspector. Ensure that you have the latest version of Safari web browser installed in your system. Ensure that you enable developer settings in your iOS device.
To get started with debugging iOS native applications, you must enable Developer Settings on your iOS device. If your Mac has an OS earlier than Mojave, the Developer settings are automatically configured. If your Mac has Mojave OS or later, configure Mojave OS Specific settings.
Once you are done configuring the settings, you can Build iOS Native Application in the Debug mode and then further, Debug the iOS Native Application using Safari Browser.
For the debugging to work, you must enable the Web Inspector developer tool on your device before debugging an application. To enable Web Inspector tool, follow these steps:
On your iOS device, open Settings.
Go to Safari > Advanced.
Toggle the button next to JavaScript to enable JavaScript in the Safari browser.
Toggle the button next to Web Inspectorto debug iOS native applications.
For the Mac OS versions earlier than Mojave, Visualizer automatically connects to the Safari JavaScript debugger, provided that the developer settings in your iOS device are configured.
For the Mac OS versions Mojave and later, full disk access and accessibility must be provided to the Terminal due to enhanced security of newer Mac OS versions.
For the debugger to run on your Mac, follow these steps:
Note: If Visualizer fails to automatically communicate with Safari to launch Web-inspector, you must debug the application manually.
To debug an application, you must first build the application in the Debug mode. To do so, follow these steps:
In Kony Visualizer, from the Build menu, click Build and Publish Native.
In the Build dialog box, from the Build Mode drop-down list, select Debug.
If you haven't configured the P12 password, .P12 certificate, Mobile Provisioning profile, target iOS version, and development method in the iPhone tab of the Project Settings, you will see an error dialog in Visualizer. Click Settings to configure the certificates. Refer to iOS automation for more information on configuring the certificates.
Follow these steps to debug JavaScript applications for an iOS device:
In Kony Visualizer, from the main menu, click Debug.
Go to Debug Native App > Connected iOS Devices.
From the list of connected devices, select your device.
If you haven't enabled the Developer settings in your iOS device already, follow the steps in the popup and click Yes.
You can select the Do not show this again checkbox to not see the popup again.
If the debug process is successful, the Safari web browser with Web Inspector is auto-launched.
In case the Safari web browser does not launch automatically, you must debug the application manually.
If your Mac OS version is Mojave or later, you must configure the Mojave-specific settings or follow the steps in the following popup.
If the application debugging fails and the Safari web browser does not launch automatically, you must configure the following steps manually:
Launch Safari web browser.
From the menu bar, go to Safari and click Preferences.
In the Preferences menu, click Advanced.
Select the Show Develop Menu In Menu Bar check box.
With Kony Visualizer, you can perform JavaScript debugging on connected Android computers and devices. This procedure assumes that you have the Google Chrome web browser installed on your computer.
Note: By default, the Android debugger uses port 9222. If there is a conflict, you can change the port that the debugger uses.
In Visualizer Enterprise in the Window menu, click Preferences. From the Preferences dialog box, click Kony Visualizer and update the Android Debugger Port settings.
In Kony Visualizer in the Edit menu, click Preferences. From the Preferences dialog box, click Build and update the Debugger ports settings.
Note: You can now use Android FP debugger from the Preview menu. This uses the Kony Quantum App app to debug the app. By default, the Android FP Debugger Port feature uses 9333. If there is a conflict, you can change the port that the debugger uses.
In Visualizer Enterprise in the Window menu, click Preferences. From the Preferences dialog box, click Kony Visualizer and update the Android FP Debugger Port settings.
In Kony Visualizer in the Edit menu, click Preferences. From the Preferences dialog box, click Build and update the Debugger ports settings.
To debug JavaScript applications for Android in Kony Visualizer:
Note: To debug applications in Kony Visualizer, you must have built the application using the Build Mode Debug. To do so, in the Build dialog box, select Debug from the Build Mode drop-down list.
You can then use the Google Chrome debugger to debug the application. For information on using the Chrome debugger, see Get Started with Debugging JavaScript in Chrome DevTools on the Google Chrome website.
Important: In Google Chrome version 66 and higher, the breakpoints do not get applied. You can write the keyword debugger in the JS files where the debugger needs to be stopped. This debugger keyword acts as a breakpoint.
Note the following behavior when debugging an Android application:
Rev | Author | Edits |
7.3 | SHS | SHS |
Copyright © 2013 Kony, Inc. All rights reserved. |