Not able to connect to apple tv !! "Making apple tv ready for development" dialog shown

I’m trying to connect apple tv with my xcode to debug my app. But I’m getting below dialog and it will never go. So I tried following steps to fix but no use.

  1. Waited for 10 mins and checked but still the same.
  2. I restarted/reset apple tv and checked but no use.
  3. Tried with different versions of xcode but no use.
  4. Tried using wifi, mobile hotspot with different networks.

Screen shot

Some times I will get this dialog and it will never go.

enter image description here

If I try to run app in this state then I will get this alert in xcode

So I’m not understanding the why its behaving like this. And how to fix this issue ?

Source: Ios