Skip to content

Commit a19acb5

Browse files
committed
chore: Add fake project files for easier inspector debugging
These files make it possible to run the test-app in Android Studio, then connect it to the devtools inspector with `ns debug android --start`. (The package.json lists a dependency, but there's no need to run `npm install` if you have the NativeScript CLI already installed globally.)
1 parent 301c634 commit a19acb5

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,25 @@ Note: You might need to run the Android Studio from the command line in order to
101101
```Shell
102102
gradlew runtests
103103
```
104+
105+
## How to Connect the Inspector
106+
107+
* Install dependencies: run command
108+
```Shell
109+
cd test-app
110+
npm install
111+
```
112+
* Run the test app in Android Studio, or manually in the emulator.
113+
* Run command
114+
```Shell
115+
npx ns debug android --start
116+
```
117+
(If you instead have the `nativescript` NPM module installed globally,
118+
you can omit the `npm install` and the `npx` prefix.)
119+
* This will print out a URL, such as
120+
`devtools://devtools/bundled/inspector.html?ws=localhost:40000`.
121+
Open this URL in Chrome or Chromium.
122+
104123
## Contribute
105124
We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/android-runtime/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).
106125

test-app/nativescript.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This is a fake config file for `ns debug` to work with test-app
2+
3+
import { NativeScriptConfig } from '@nativescript/core';
4+
5+
export default {
6+
id: 'com.tns.testapplication',
7+
appPath: 'app',
8+
} as NativeScriptConfig;

test-app/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"comment": "This is a fake package.json file for `ns debug` to work with test-app. No need to run `npm install`",
3+
"name": "com.tns.testapplication",
4+
"version": "1.0.0",
5+
"private": true,
6+
"dependencies": {
7+
"@nativescript/core": "~8.4.0",
8+
"nativescript": "~8.4.0"
9+
},
10+
"devDependencies": {}
11+
}

0 commit comments

Comments
 (0)