Play to Device working on Production Device

I can’t seem to get Play to Device testflight to not keep crashing after I connect from Unity on Production Device (?)

Are there new configs or versions of stuff that needs to be used etc?

same here, hope there is a fix

so if you set the timeout higher in the play to device settings in the editor and then just keep opening the app on the vision pro after hitting play it will eventually work.

hopefully they fix this, not a great experience as is.

Haven’t gotten it to work on device either

I haven’t been able to get it to run on device, only on the simulator. I can successfully ping the Vision Pro on my local network but when I run netcat, it refuses connection to port 9876.

nc -zv 192.168.4.99 9876

nc: connectx to 192.168.4.99 port 9876 (tcp) failed: Connection refused

This is what I found as well. The play to device gets backgrounded and Unity can’t properly connect. We’re working to resolve it internally but currently the work flow I’ve found to work is:

  1. Open P2D on device
  2. Configure Unity with the IP in the P2D panel
  3. Hit play in Unity
  4. Reopen the play to device app 4-6 times in a row on device

I was not able to connect to the Play To Device host app on port 9876 on the Vision Pro with firmware v1.0.0 Only when I updated to v1.0.2 did connections to port 9876 start working.

Unfortunately, while connections now seem to be occurring, the Play To Device host app disappears every time I press play in the Unity Editor (I believe this may be the backgrounding you are mentioning?) Once the Play To Device host app has been backgrounded, I can’t relaunch the app until I reboot the Vision Pro.

Are you trying to launch it from the app home screen? That’s what worked for me.

Hi Dan,

Yes I am launching the Play to Device app in the Vision Pro from the home screen. The problem is that as soon as the Unity Editor connects, the Play To Device app window disappears and the app running in the Unity Editor does not display in the headset. If I try to relaunch the Play to Device app again in the Vision Pro from the home screen, nothing happens.

I can emulate this same behavior by running the NetCat command line utility from a terminal window on my Mac.

nc -zv 192.168.4.99 9876
Connection to 192.168.4.99 port 9876 [tcp/sd] succeeded!

I have confirmed that the Play to Device app is backgrounded in both these cases explaining why trying to launch it again from the home screen has no effect. I can restarted the app by first force quitting it in the Vision Pro (hold both crown and capture buttons simultaneously until Force to Quit menu appears).

I’m also now seeing slightly different behavior on 2022.3.19f1 vs 2022.3.18f1. On 19f1, after the Play To Device window disappears, the Unity Editor displays a spinner and never continues playback of the app. Only after Force Quitting the app on the headset does the Unity Editor app playback proceed.

I tried restarting with Force Quit and restarting play mode in the Unity Editor about a dozen times and was never able to get anything to display on the headset.

2 Likes

Hi @Yumby

If you haven’t seen it already, I posted some additional information and workarounds about this backgrounding problem in the pinned Play to Device thread.

It doesn’t offer any perfect solutions (we’re working on that!) but hope it helps in the interim!

–Tim

1 Like

how high are you setting the timeout?

Hi Ina, it doesn’t seem to matter. No matter how short/long I set the timeout, the Unity Editor continues to spin and does not resume playback unless the Play to Device host app is Force Quit on the headset.

have u tried starting it like 10 times on device

Yes, I have Force Quit the app and reentered Unity Play mode dozens of time and it never works.

Unity - any update on Play to Device fix?

Major major showstopper that increases dev time like 100x due to needing to build to device each time instead of using Unity Remote - what unity was great at

Hey checking back. Wondering if 1.0.4 might fix this - thanks lmk

Hi, all, I’m trying to do the same. But my problem seems even worse than what you guys are talking about.

So first, I got the vision OS simulator working with play to device, which doesn’t require any manual setting, just launch the p2d app on simulator and it auto pops up in the unity editor p2d panel with a green check mark for the connection status.

But on the device, I have to manually add it using ip address and 9876 port, but it never showed me the green check mark for the connection status. Is this the same problem you guys are discussing? Or are you guys already got the green check for connection status, and the problem is after you hit play in unity editor?

OK, actually got it working after reboot Vision Pro device. And I guess the connection status never turned green, you just keep relaunching the p2dhost app for 10 times, and it will run (but connection status still red …)

The other big problem (which might be related to the above connection problem) is that it takes long time to switch scene (e.g. when running the template project, after hitting the “exit view” button in unbounded scene, it got stuck and takes maybe 30 seconds to eventually switch to the bounded scene, vice versa)

Another dumb question I want to check is that how do I turn off XR simulation environment when doing play to device?

i think they are supposed to be pushing a fix to this any day now ?

Yup, hopefully. But just want to clarify, my “other big problem” acutally may not be related to p2d. Because even when I build it to device, I still see the same lag when switching scenes.

But I’m still confused about my last “dumb question”: how to turn off XR simulation environment when p2d?
@ina , do you have any idea? :grin: