NRE remote debugging

NRE remote debugging

With the NRE, you can debug the running app using the Devices inspect function of the Chrome and Edge browsers. It supported in Windows, macOS, and Android operating systems.

Developed scripts and JavaScript libraries can be debugged. It does not support modules installed with DeviceAdaptors or engine internal code debugging.

Project settings

Change the enableinspector property value of Environment to true.

Android > MainActivity.java

When writing the MainActivity.java code in Android Studio, add the setRPP function.

if(bootstrapURL != null) {
	setBootstrapURL(bootstrapURL);
	setProjectURL(projectUrl);
	setRPP("9223");
}

MainActivity.java

Because this operates as a local host, the IP address can be omitted and only the port number is to be entered.

The port number can be changed.

Run settings

Windows

Add the -RPP option to the nexacro.exe execution option as shown below and run it.

nexacro.exe -K "INSPECTOR_TEST" -S "http://localhost:8080/start.json" -RPP 127.0.0.1:9223
nexacro.exe -K "INSPECTOR_TEST" -S "http://localhost:8080/start.json" -RPP 9223

If only PORT is set when setting the RPP option, it operates as the localhost.

macOS

When running in the terminal, add the -RPP option as shown below and execute.

open nexaApp.app --args -K INSPECTOR_TEST -S http://localhost:8080/start_macos.json -RPP "127.0.0.1:9223"
open nexaApp.app --args -K INSPECTOR_TEST -S http://localhost:8080/start_macos.json -RPP "9223"

If only PORT is set when setting the RPP option, it operates as the localhost.

Android

The following settings are required on the Android device to be connected.

1

Activating USB debugging option

For information on how to activate the USB debugging option, refer to the corresponding manufacturer's manual.

https://developer.android.com/studio/debug/dev-options#enable

2

Connect the Android device via USB to the desktop where Android Studio is installed.

Depending on the device, there may be restrictions on USB connection.

https://developers.google.com/web/tools/chrome-devtools/remote-debugging#troubleshooting

3

Enter the following in the Android Studio terminal window.

adb start-server
adb forward tcp:9223 tcp:9223

4

Run the project in Android Studio.

The app will be running on the connected Android device.

Android (wireless connection)

If the desktop and the device you are connecting to are using the same network, a wireless connection can be established. A USB connection is required for initial connection setup, and the debugging afterwards can be proceeded without the USB connection once the setup is complete.

1

Activating USB debugging option

2

Connect the Android device via USB to the desktop where Android Studio is installed.

3

Enter the following in the Android Studio terminal window.

adb kill-server
adb start-server
adb tcpip 5555
adb connect 192.168.0.58
adb devices

5555 is the port for communication between the Android device and the desktop.

192.168.0.58 is the IP of the Android device. Verifying the IP and enter the value.

4

If a wireless connection is established, the connected Android device IP is displayed as follows.

List of devices attached
192.168.0.58:5555 device

5

Disconnect the USB.

6

Enter the following in the Android Studio terminal window.

adb forward tcp:9223 tcp:9223

7

Running the project in Android Studio will run the app on the Android device.

Run the Devices inspect feature

1

Launch the Chrome browser and enter "chrome://inspect" in the address bar.

chrome://inspect

2

Click the Configure button to open the Target discovery settings window.

If the Discover network targets is not checked, check it.

3

Input the RPP address value set earlier to the Target discovery settings window.

4

Run the app, and the key value of the launched app is displayed in the Remote Target item.

5

Click the inspect URL under the Target item to be redirected to the console window where you can view the results of the trace method execution or error messages.

6

Click the open dedicated devtools for node URL to open a window for exploring the server resources.

In the [Sources > Node] tab, you can select the desired file, add breakpoints, or perform additional debugging tasks.

If the app is not visible in Remote Target

If the app is not displayed for more than 20 seconds after launching, take the following measures.

1

Close the browser and reestablish the connection.

2

Check that the inspect feature is running properly in the app.

After running the app, accessing the following URL in your browser should display the information. If there is no response, there may be a problem with your project settings or other issues.

[Target discovery settings RPP Address]/json/list
http://127.0.0.1:9223/json/list

Option settings for Pause While Loading feature

Because NRE remote debugging connects to the running app and executes debugging, it is not possible to debug errors or issues that occur during loading. A setting to forcibly pause during loading can be added through the additional options as follows.

The pause while loading feature pauses upon the completion of receiving the theme file (theme.map.js), then waits for the Devices inspect connection. Depending on the project loading method or network conditions, some files may not be downloaded at this time, and the files not downloaded cannot be debugged.

Windows, macOS

Add the -brk "true" option to the nexacro.exe execution option as shown below and execute it.

nexacro.exe -K "INSPECTOR_TEST" -S "http://localhost:8080/start.json" -RPP 127.0.0.1:9223 -brk "true"
nexacro.exe -K "INSPECTOR_TEST" -S "http://localhost:8080/start.json" -RPP 9223 -brk "true"

macOS

When running in the terminal, add the -brk "true" option as shown below and execute.

open nexaApp.app --args -K INSPECTOR_TEST -S http://localhost:8080/start_macos.json -RPP "127.0.0.1:9223" -brk "true"
open nexaApp.app --args -K INSPECTOR_TEST -S http://localhost:8080/start_macos.json -RPP "9223" -brk "true"

Android > MainActivity.java

Add setBRK function when writing MainActivity.java code in Android Studio.

if(bootstrapURL != null) {
	setBootstrapURL(bootstrapURL);
	setProjectURL(projectUrl);
	setRPP("9223");
	setBRK("true")
}