Debug on Android Device

Filter by IDE
Select the Progress AppBuilder client you are currently using for development.

IDE

Debugging on device is an experimental feature. You can debug on device from the classic Windows desktop client, the extension for Visual Studio or the command-line interface.

In the Microsoft Visual Studio 2013 and later, you can debug on device using the AppBuilder debug tools or the built-in Microsoft Visual Studio debugger. For earlier versions of Microsoft Visual Studio, you can debug on device only using the AppBuilder debug tools.

You can debug your app while running it on physical device, connected via USB cable or virtual device managed by the native Android emulator. For debugging NativeScript apps, AppBuilder uses Node Inspector.

Currently, you can work with the Sources and the Console tabs and tools of the debug tools.

IMPORTANT: On Android 5.x and 6.x devices, the AppBuilder debug tools launch with enabled screencast. This might impact the performance of your app and might cause connectivity issues. Consider disabling screencast from the respective toggle in the top bar of the debug tools.

Prerequisites

  • Verify that your preferred AppBuilder client is running and you are logged in.
  • Verify that your device and application meet the requirements for debugging on device.
    For more information about the prerequisites for debugging on device, see Requirements for Debugging on Device.

Procedure

In-Browser

Debugging on connected device is an experimental feature and is not applicable to the in-browser client. To debug your applications on a connected device, run the classic Windows desktop client or the extension for Visual Studio.

Windows

For apps developed with TypeScript, you cannot debug the TypeScript source files. You need to debug the transpiled JavaScript files.

  1. Verify that you have connected your physical or virtual device and the classic Windows desktop client recognizes it.
    For more information, see Connect Android Device.
  2. In the main menu bar in the classic Windows desktop client, select RunBuild and deploy and wait for AppBuilder to install the application on your device.
  3. On your device, run the application.
  4. In the classic Windows desktop client, in the status bar, click Show Mobile Devices.
  5. Select your device and click Debug.
  6. Select your app from the list of debuggable apps found on the device.
    AppBuilder lists all apps that are enabled for debugging and are currently running in the foreground or suspended in the background.
  7. Click Attach to attach the debug tools to the device.

Visual Studio

To debug on Android devices with the AppBuilder debug tools, perform the following steps.

For apps developed with TypeScript, you cannot debug the TypeScript source files. You need to debug the transpiled JavaScript files.

  1. Verify that you have connected your physical or virtual device and the extension for Visual Studio recognizes it.
    For more information, see Connect Android Device.
  2. Verify that you have applied the Debug build configuration.
  3. In the main menu bar in Microsoft Visual Studio, select AppBuilderBuild <app_name> and Deploy and wait for AppBuilder to install the application on your device.
  4. On your device, run the application.
  5. In the main menu bar in Microsoft Visual Studio, select AppBuilderDevices List.
  6. Select your device and click Debug.
  7. Select your app from the list of debuggable apps found on the device.
    AppBuilder lists all apps that are enabled for debugging and are currently running in the foreground or suspended in the background.
  8. Click Attach to attach the debug tools to the device.

To debug on Android devices with the Microsoft Visual Studio debug tools, perform the following steps.

  1. Verify that you have connected your physical or virtual device and the extension for Visual Studio recognizes it.
    For more information, see Connect Android Device.
  2. Verify that you have applied the Debug build configuration.
  3. In the main menu bar in Microsoft Visual Studio, select AppBuilderBuild <app_name> and Deploy and wait for AppBuilder to install the application on your device.
  4. On your device, run the application.
  5. In the code editor, open the file that you want to debug.
    • If you are using JavaScript to develop your app, open the JS file that you want to debug.
    • If you are using TypeScript to develop your app, open the TS file that you want to debug.
      If you do not have the "sourceMap": true or the "inlineSourceMap": true compiler option in your tsconfig.json file, you will not be able to debug your TypeScript sources using the Microsoft Visual Studio built-in debug tools.
  6. In the leftmost margin of the code editor, click next to a line number to set a breakpoint.
    You can set breakpoints this way at any point of the debugging process.
  7. In the Standard toolbar, from the Start Debugging drop-down menu, select your device.
  8. Click Start Debugging.
  9. Debug your app with the built-in debugger.
    For more information, see How Do I... Topics: Debugger.

CLI

In this version of the command-line interface, you cannot debug on device from the command-line interface on macOS systems.

For apps developed with TypeScript, you cannot debug the TypeScript source files. You need to debug the transpiled JavaScript files.

  1. Verify that you are running on a Windows system.
  2. Verify that you have connected your physical or virtual device and the extension for Visual Studio recognizes it.
    For more information, see Connect Android Device.
  3. In the command prompt, navigate to the directory that contains your app.
  4. Run the following command and wait for AppBuilder to install the application on your device..

    appbuilder deploy android --debug
    
  5. Run the following command.

    appbuilder debug android
    
  6. Select your device.
  7. Select your app from the list of debuggable apps found on the device.
  8. Select the application view for your app.
  9. Click Debug to attach the debug tools to the device.

Next Steps

Continue writing your code.

See Also

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.