TVJS debugging?

Hi all -


Enjoying working with TVJS/TVML, neat little way to build stuff.


Haven't found a reasonable way of debugging what's going inside the JS runtime however - console.logs disappear into nowhere, and it doesn't appear I can debug via the Web Inspector (which makes sense, as its not WebKit)


Any suggestions?

Accepted Answer

You can use Safari's web inspector

Have you tried the web inspector?

The "TVMLCatalogUsingTVMLTemplates" says to use the Safari Web Inspector in the readme file.

"To help debug and experiment, you can use the Safari WebInspector to attach to the JavaScript context. WebInspector provides you with a full JavaScript debugging environment. You will need to turn on the Develop menu from Safari > Preferences > Advanced. Select your device from the Develop drop down menu to see a list of running JavaScript contexts."

When running the TVOS similator, there don't seem to be any Javascript contexts to attache the safari web inspector to. Is there something that needs to be enabled?

This is silly, but sometimes you might need to restart Safari and/or load up a page, hit reload and check again.

Are you on Safari 9.0?

You will need to download the latest Safari 9.0 seed, or the nightly WebKit builds to see the TVJS contexts appear in WebInspector.

)I am on Safari 9 (Version 9.0 (10601.1.56)), Yosemite (10.10.5 (14F27)) and I can't see the simulator's context in Safari's develop menu. It's quite frustrating.


Can you think of any other reasons why the TVOS simulator may not hook up to Safari? They are on the same subnet (the same IP, since it's a simulator).

I was able to debug using the Web Inspector last night. I was running Safari version 8.0.8 (10600.8.9). Today, it didn't work. Super buggy.

Using Safari, Version 8.0.8 (10600.8.9) I got the inspector working by

  1. 1Opening the project in xcode 7.1 beta.
  2. Build and Run app from xcode,
  3. Waiting for Simulator to start then wait for the app to open.
  4. Opened Safari, could see simulator in the "Develop" menu,
  5. Select the running tvOS app from under the simular.



If you can't see your app try doing the below

  • Restart Safari.
  • Ensure you can navigate to the page in safari.
  • Do a clean on the xcode project.
  • Restart your Mac.

"Ensure you can navigate to the page in safari."


What does this mean? What page am I supposed to be navigating to? This is a TVOS app.

This not working at all for me.


Simulator runs build and runs app.


Simulator appears in the Develop menu, but all I see is a greyed out "No Inspectable Applications"


Shouldn't I see som app if the Simulator is running an app?

I was having the same problem. Safari 9.0.1 and Yosemite 10.10.5. Simulator was running fine and the Develop menu actually had Simulator Item available but it showed the greyed out "No Inspectable Applications" in the menu. I exited (cmd+q) safari, xcode, and the simulator. I started up Safari, got Xcode running and ran the simulator (in that order) and my app showed up in the Safari>Develop>Simulator menu.


Thanks for the help peeps!

TVJS debugging?
 
 
Q