Skip to content

Plug-n-play Nativescript Android debuggable app #510

@petekanev

Description

@petekanev

Plug-n-play Nativescript Android debuggable app

Overview

With the rapid growth of NativeScript, and additions of new features, as well as fixes to the core runtime, we face the necessity to debug the NS android runtime and its underlying components with user NS applications in an easier manner - a plug-and-debug app, where we, the android-runtime team and fellow contributors will be able to plug the contents of the platforms/android/ folder of a prebuilt application right into the plug-n-play application and debug it as if we were debugging the test-app that we currently have.

Technical Details

Since we strive to keep the NS Android applications as close as possible, structurally, to plain Android applications, we may not need to make any major adjustments, if any, to the directory tree.

The execution of tns build android step results in a built NS Android application which contains all node_modules, plugins, metadata, bindings, source code, AndroidManifest, and styles inside the platforms/android/src folder. It is the result of all complex build steps performed by the CLI, and execution of the project-template build.gradle, sans the apk.

We can:

  • plug the src folder and debug away with a modified build.gradle on our side that will do simple operations like set the app as debuggable and deploy it to a device. - easiests, but skips over several steps of the whole ‘build process’ - already done with the test-app, can be simplified for quick debugging.
  • rewrite the default build.gradle to comply completely with the android studio project guidelines so that attaching and debugging the project can be done as easy as importing a native android application.

In either case the gradle-experimental plugin will need be used to configure the project to allow use of the native debugger

Impact

This new addition does not imply any breaking changes

Summary (tl;dr)

Create a blank android project where a prebuilt NS android app can be plugged in in order to debug the android-runtime, and its components.

ping @NativeScript/android-runtime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions