Inspector wont stay connected, shows error session terminated

steps:

  1. launch the app using inspector of appium
  2. now launch the app again through the code written in pycharm
  3. refresh the inspector
    observation:
    it shows error: ‘session terminated’
    every time i want to inspect something i need to launch the app again through the appium inspector ‘start session’, i even tried to use ‘attach to session’, that works only until i launch the code though pycharm again.