7

Hello I m new to NativeScript, as per the docs available on NativeScript site, I had created a demo app with NativeSript + Angular and deployed that on device but for debugging i want it to run on web browser like chrome to get the view of app and debug. As per the docs i m able to debug it in chrome but I can get the view of app to run in chrome. Is there some way to do that.

Rohan Sampat
  • 930
  • 1
  • 13
  • 30
  • 1
    You will have to run the application on an emulator or device. You cannot use chrome to view the application. – JoshSommer Jul 30 '17 at 11:56
  • 1
    ok but if i want to inspect an element then how will I do it. – Rohan Sampat Jul 31 '17 at 06:16
  • you can run the debugger with the commands `tns debug android` or `tns debug ios` both of those will give you access to the chrome debugger. for iOS it opens up it's own instance. With Android it will give you a link to paste into your browser window. – JoshSommer Jul 31 '17 at 11:16
  • Yes I know that way but if I want to inspect some elements their styles in chrome or some other browser, that I want to know, is there some way or not. – Rohan Sampat Jul 31 '17 at 11:25

2 Answers2

16

Here you go.

tns debug ios --chrome

You will then want to pay close attention to your terminal and find the following line.

To start debugging, open the following URL in Chrome:

enter image description here

Open up your browser and copy and paste that path and you will get access to the developer tools.

Rick
  • 12,606
  • 2
  • 43
  • 41
3

Enter following Command in terminal

tns debug android

check terminal and find following URL

chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40000

copy above url and paste in crome and start debugging

Amar Yadav
  • 182
  • 1
  • 10