pid = device.get_process(name).pid
session = None
display_name = name
bundle_identifier = ''
try:
if not pid:
pid = device.spawn([bundle_identifier])
session = device.attach(pid)
device.resume(pid)
else:
session = device.attach(pid, realm="native")
except Exception as e:
print(e)
return session, display_name, bundle_identifier