The Debug tab is being retired because, as previously announced and noted in the release notes, future editions of the Intel XDK will focus on the development of IoT (Internet of Things) apps and IoT mobile companion apps. Since we introduced the Intel XDK IoT Edition in September of 2014, the need for accessible IoT app development tools has increased dramatically. At the same time, HTML5 mobile app development tools have matured significantly. Given the maturity of the free open-source HTML5 mobile app development tools, we feel you are best served by using those tools directly.
Similar reasoning applies to the hosted weinre server (on the Test tab) and the Live Development Pane on the Develop tab.
Attempting to debug a built mobile app (with weinre, remote CDT or Safari Web Inspector) seems like a difficult or impossible task. There are, in fact, many things you can do with a built app that do not require rebuilding and reinstalling your app between each source code change.
You can continue to use the Simulate tab for debugging that does not depend on third-party plugins. Then switch to debugging a built app when you need to deal with third-party plugin issues that cannot be resolved using the Simulate tab. The best place to start is with a built Android app installed directly on-device, which provides full JavaScript and CSS debugging, by way of remote Chrome* DevTools*. For those who have access to a Mac, it is also possible to use remote web inspector with Safari to debug a built iOS app. Alternatively, you can use weinre to debug a built app by installing a weinre server directly onto your development system. For additional help on using weinre locally, watch Using WEINRE to Debug an Intel® XDK Cordova* App (beginning at about 14:30 in the video).
The interactive JavaScript console is your "best friend" when debugging with remote CDT, remote Web Inspector or weinre in a built app. Watch this video from ~19:30 for a technique that shows how to modify code during your debug session, without requiring a rebuild and reinstall of your app, via the JavaScript debug console. The video demonstrates this technique using weinre, but the same technique can also be used with a CDT console or a Web Inspector console.
Likewise, use the remote CDT CSS editor to try manipulate CSS rules in order to figure out how to best style your UI. Or, use the Simulate tab or the Brackets* Live Preview feature. The Brackets Live Preview feature utilizes your desktop browser to provide a feature similar to Intel XDK Live Layout Editing. If you use the Google* Chrome browser with Brackets Live Preview you can use the Chrome device emulation feature to simulate a variety of customizable device viewports.
There are a variety of things that can go wrong when attempting to use the Debug tab:
- your test device cannot be seen by the Debug tab:
- the debug module build fails
- the debug module builds, but fails to install onto your test device
- the debug module builds and installs, but fails to "auto-start" on your test device
- your test device has run out of memory or storage and needs to be cleared
- there is a problem with the adb server on your development system
Other problems may also arise, but the above list represents the most common. Search this FAQ and the forum for solutions to these problems. Also, see the Debug tab documentation for some help with installing and configuring your system to use the adb debug driver with your device.
- Both Intel XDK and App Preview mobile app must be logged in with the same user credentials.
- Both devices must be on the same subnet.
Note: Your computer's Security Settings may be preventing Intel XDK from connecting with devices on your network. Double check your settings for allowing programs through your firewall. At this time, testing on Wi-Fi does not work within virtual machines.
- Ensure that both Intel XDK and App Preview mobile app are logged in with the same user credentials and are on the same subnet
- Launch App Preview on the device
- Log into your Intel XDK account
- Select "Local Apps" to see a list of all the projects in Intel XDK Projects tab
- Select desired app from the list to run over Wi-Fi
Note: Ensure the app source files are referenced from the right source directory. If it isn't, on the Projects Tab, change the 'source' directory so it is the same as the 'project' directory and move everything in the source directory to the project directory. Remove the source directory and try to debug over local Wi-Fi.
[Android*] Simply kill the app running on your device as an Active App on Android* by swiping it away after clicking the "Recent" button in the navigation bar. Alternatively, you can clear data and cache for the app from under Settings App > Apps > ALL > App Preview.
[iOS*] By double tapping the Home button then swiping the app away.
[Windows*] You can use the Windows* Cache Cleaner app to do so.
We officially only support and test Android* 4.x and higher, although you can use Cordova for Android* to build for Android* 2.3 and above. For older Android* devices, you can use the build system to build apps and then install and run them on the device to test. To help in your testing, you can include the weinre script tag from the Test tab in your app before you build your app. After your app starts up, you should see the Test tab console light up when it sees the weinre script tag contact the device (push the "begin debugging on device" button to see the console). Remember to remove the weinre script tag before you build for the store.
Conflicts between different versions of adb can cause device detection issues.
Ensure that all applications, such as Eclipse, Chrome, Firefox, Android Studio and other Android mobile development tools are not running on your workstation. Exit the Intel XDK and kill all adb processes that are running on your workstation. Restart the Intel XDK only after you have killed all instances of adb on your workstation.
You can scan your disk for copies of adb using the following command lines:
[Linux*/OS X*]:
$ sudo find / -name adb -type f
[Windows*]:
> cd \> dir /s adb.exe
For more information regarding Android* USB debug, visit the Intel XDK documentation on debugging and testing.
See the Debug and Test Overview doc page for a more complete overview of your debug options.
When using the Test tab with Intel App Preview your app will not include any third-party plugins, only the "core" Cordova plugins.
The Emulate tab will load the JavaScript layer of your third-party plugins, but does not include a simulation of the native code part of those plugins, so it will present you with a generic "return" dialog box to allow you to execute code associated with third-party plugins.
When debugging Android devices with the Debug tab, the Intel XDK creates a custom debug module that is then loaded onto your USB-connected Android device, allowing you to debug your app AND its third-party Cordova plugins. When using the Debug tab with an iOS device only the "core" Cordova plugins are available in the debug module on your USB-connected iOS device.
If the solutions above do not work for you, then your best bet for debugging an app that contains a third-party plugin is to build it and debug the built app installed and running on your device.
[Android*]
1) For Crosswalk* or Cordova for Android* build, create an intelxdk.config.additions.xml file that contains the following lines:
<!-- Change the debuggable preference to true to build a remote CDT debuggable app for --><!-- Crosswalk* apps on Android* 4.0+ devices and Cordova apps on Android* 4.4+ devices. --><preference name="debuggable" value="true" /><!-- Change the debuggable preference to false before you build for the store. -->
and place it in the root directory of your project (in the same location as your other intelxdk.config.*.xml files). Note that this will only work with Crosswalk* on Android* 4.0 or newer devices or, if you use the standard Cordova for Android* build, on Android* 4.4 or greater devices.
2) Build the Android* app
3) Connect your device to your development system via USB and start app
4) Start Chrome on your development system and type "chrome://inspect" in the Chrome URL bar. You should see your app in the list of apps and tabs presented by Chrome, you can then push the "inspect" link to get a full remote CDT session to your built app. Be sure to close Intel XDK before you do this, sometimes there is interference between the version of adb used by Chrome and that used by Intel XDK, which can cause a crash. You might have to kill the adb process before you start Chrome (after you exit the Intel XDK).
[iOS*]
Refer to the instructions on the updated Debug tab docs to get on-device debugging. We do not have the ability to build a development version of your iOS* app yet, so you cannot use this technique to build iOS* apps. However, you can use the weinre script from the Test tab into your iOS* app when you build it and use the Test tab to remotely access your built iOS* app. This works best if you include a lot of console.log messages.
[Windows* 8]
You can use the test tab which would give you a weinre script. You can include it in the app that you build, run it and connect to the weinre server to work with the console.
Alternatively, you can use App Center to setup and access the weinre console (go here and use the "bug" icon).
Another approach is to write console.log messages to a <textarea> screen on your app. See either of these apps for an example of how to do that:
“Media” mode is the default USB connection mode, but due to some unidentified reason, it frequently fails to work over USB on Windows* machines. Configure the USB connection mode on your device for "Camera" instead of "Media" mode.
You can try the following to have your app run on the device via debug tab:
- Place the intelxdk.js library before the </body> tag
- Place your app specific JavaScript files after it
- Place the call to initialize your app in the device ready event function
You may be running into a RAM or storage problem on your Android device; as in, not enough RAM available to load and install the special App Preview Crosswalk app (APX) that must be installed on your device. See this site (http://www.devicespecifications.com) for information regarding your device. If your device has only 512 MB of RAM, which is a marginal amount for use with the Intel XDK Debug tab, you may have difficulties getting APX to install.
You may have to do one or all of the following:
- remove as many apps from RAM as possible before installing APX (reboot the device is the simplest approach)
- make sure there is sufficient storage space in your device (uninstall any unneeded apps on the device)
- install APX by hand
The last step is the hardest, but only if you are uncomfortable with the command-line:
- while attempting to install APX (above) the XDK downloaded a copy of the APK that must be installed on your Android device
- find that APK that contains APX
- install that APK manually onto your Android device using adb
To find the APK, on a Mac:
$ cd ~/Library/Application\ Support/XDK
$ find . -name *apk
To find the APK, on a Windows machine:
> cd %LocalAppData%\XDK> dir /s *.apk
For each version of Crosswalk that you have attempted to use (via the Debug tab), you will find a copy of the APK file (but only if you have attempted to use the Debug tab and the XDK has successfully downloaded the corresponding version of APX). You should find something similar to:
./apx_download/12.0/AppAnalyzer.apk
following the searches, above. Notice the directory that specifies the Crosswalk version (12.0 in this example). The file named AppAnalyzer.apk is APX and is what you need to install onto your Android device.
Before you install onto your Android device, you can double-check to see if APX is already installed:
- find "Apps" or "Applications" in your Android device's "settings" section
- find "App Preview Crosswalk" in the list of apps on your device (there can be more than one)
If you found one or more App Preview Crosswalk apps on your device, you can see which versions they are by using adb at the command-line (this assumes, of course, that your device is connected via USB and you can communicate with it using adb):
- type
adb devices
at the command-line to confirm you can see your device - type
adb shell 'pm list packages -f'
at the command-line - search the output for the word
app_analyzer
The specific version(s) of APX installed on your device end with a version ID. For example:com.intel.app_analyzer.v12
means you have APX for Crosswalk 12 installed on your device.
To install a copy of APX manually, cd to the directory containing the version of APX you want to install and then use the following adb command:
$ adb install AppAnalyzer.apk
If you need to remove the v12 copy of APX, due to crowding of available storage space, you can remove it using the following adb command:
$ adb uninstall com.intel.app_analyzer.v12
or
$ adb shell am start -a android.intent.action.DELETE -d package:com.intel.app_analyzer.v12
The second one uses the Android undelete tool to remove the app. You'll have to respond to a request to undelete on the Android device's screen. See this SO issue for details. Obviously, if you want to uninstall a different version of APX, specify the package ID corresponding to that version of APX.
For a detailed discussion regarding how to use Chrome on your desktop to debug an app running on a USB-connected device, please read this doc page Remote Chrome* DevTools* (CDT).
Check to be sure the following conditions have been met:
- The version of Chrome on your desktop is greater than or equal to the version of the Chrome webview in which you are debugging your app.
For example, Crosswalk 12 uses the Chrome 41 webview, so you must be running Chrome 41 or greater on your desktop to successfully attach a remote Chrome debug session to an app built with Crosswalk 12. The native Chrome webview in an Android 4.4.2 device is Chrome 30, so your desktop Chrome must be greater than or equal to Chrome version 30 to debug an app that is running on that native webview. - Your Android device is running Android 4.4 or higher, if you are trying to remote debug an app running in the device's native webview, and it is running Android 4.0 or higher if you are trying to remote debug an app running Crosswalk.
When debugging against the native webview, remote debug with Chrome requires that the remote webview is also Chrome; this is not guaranteed to be the case if your Android device does not include a license for Google services. Some manufacturers do not have a license agreement with Google for distribution of the Google services on their devices and, therefore, may not include Chrome as their native webview, even if they are an Android 4.4 or greater device. - Your app has been built to allow for remote debug.
Within the intelxdk.config.additions.xml
file you must include this line: <preference name="debuggable" value="true" />
to build your app for remote debug. Without this option your app cannot be attached to for remote debug by Chrome on your desktop.
In the obsolete intel.xdk apis there is a property you can test to detect if your app is running within the Emulate tab or on a device. That property is intel.xdk.isxdk
. A simple alternative is to perform the following test:
if( window.tinyHippos )
If the test passes (the result is true
) you are executing in the Emulate tab.
This is a known issue but a resolution for the problem has not yet been determined. If you find yourself facing this issue you can do the following to help resolve it.
On a Windows machine, exit the Intel XDK and open a "command prompt" window:
> cd %LocalAppData%\XDK\> rmdir cdt_depot /s/q
On a Mac or Linux machine, exit the Intel XDK and open a "terminal" window:
$ find ~ -name global-settings.xdk
$ cd <location-found-above>
$ rm -Rf cdt_depot
Restart the Intel XDK and try the Debug tab again. This procedure is deleting the cached copies of the Chrome DevTools that were retrieved from the corresponding App Preview debug module that was installed on your test device.
One observation that causes this problem is the act of removing one device from your USB and attaching a new device for debug. A workaround that helps sometimes, when switching between devices, is to:
- switch to the Develop tab
- close the XDK
- detach the old device from the USB
- attach the new device to your USB
- restart the XDK
- switch to the Debug tab
The iOS simulator only runs on Apple Macs... We're trying to make the Intel XDK accessible to developers on the most popular platforms: Windows, Mac and Linux. Additionally, the iOS simulator requires a specially built version of your app to run, you can't just load an IPA onto it for simulation.
There's no purpose behind it, it's simply difficult to emulate/simulate every feature and quirk of every device.
You can buy a used iPod and that works quite well for testing iOS apps. Of course, the screen is smaller and there is no compass or phone feature, but just about everything else works like an iPhone. If you need to do a lot of iOS testing it is worth the investment. A new iPod costs $200 in the US. Used ones should cost less than that. Make sure you get one that can run iOS 8.
When you run the Android emulator you are running on a fictitious device, but it is a better emulation than what you get with the iOS simulator and the Intel XDK Emulate tab. The Crosswalk webview further abstracts the system so you get a very good simulation of a real device. However, considering how inexpensive and easy Android devices are to obtain, we highly recommend you use a real device (with the Debug tab), it will be much faster and even more accurate than using the Android emulator.
Because the Intel XDK Emulate tab is a Chromium browser, so what you get is the behavior inside that Chromium browser along with some conveniences that make it appear to be a hybrid device. It's poorly named as an emulator, but that was the name given to it by the original Ripple Emulator project. What it is most useful for is simulating most of the core Cordova APIs and your basic application logic. After that, it's best to use real devices with the Debug tab.
Ensure the splash screen plugin is selected. Custom splash screens only get displayed on a built app. The emulator and app preview will always use Intel XDK splash screens. Please refer to the 9-Patch Splash Screen sample for a better understanding of how splash screens work.
This is where the remote debug features of the Debug tab are extremely valuable. Using a remote CDT (or remote Safari with a Mac and iOS device) are the only real options for finding such issues. WEINRE and the Test tab do not work well in that situation because when the script stops WEINRE stops.
We are working on streamlining the debug process. There are still obstacles that need to be overcome to insure the process of connecting to a device over USB is painless.
The Debug tab, for remote debug over USB can be used with both Android and iOS devices. Android devices work best. However, at this time, debugging with the Debug tab and third-party plugins is only supported with Android devices (running in a Crosswalk webview). We are working on making the iOS option also support debug with third-party plugins, like what you currently get with Android.
Some Android devices include a feature that prevents some applications and services from auto-starting, as a means of conserving power and maximizing available RAM. On Asus devices, for example, there is an app called the "Auto-start Manager" that manages apps that include a service that needs to start when the Android device starts.
If this is the case on your test device, you need to enable the Intel App Preview application as an app that is allowed to auto-start. See the image below for an example of the Asus Auto-start Manager:
Another thing you can try is manually starting Intel App Preview on your test device before starting a debug session with the Debug tab.
The only way to retrieve a list of apps in App Preview is to login. If you do not wish to share your credentials, you can create an alternate account and push your app to the cloud using App Preview and share that account's credentials, instead.
The Live Layout Editing feature of the Intel XDK is built on top of the Brackets Live Preview feature. Most of the issues you may experience with Live Layout Editing can be addressed by reviewing this Live Preview Isn't Working FAQ from the Brackets Troubleshooting wiki. In particular, see the section regarding using Chrome with Live Preview.
Some versions of App Preview include an XHR override library that is designed to deal with issues related to loading file:// URLs outside of the local app filesystem (this is something that is unique to App Preview). Unfortunately, this override appears to cause problems with the return codes for some AJAX, XHR and Angular $http calls. This XHR special handling code can be disabled by adding a "data-noxhrfix" property to your app's <head> tag, in your app's index.html file. For example:
<!DOCTYPE html><html><head data-noxhrfix><meta charset="UTF-8">
...
This override should only apply to situations where the result status is zero and the responseURL is not empty.
Back to FAQs Main