code: def hexagon_launcher(
      hexagon_server_process,
      rpc_server_port,
      tvm_tracker_host,
      tvm_tracker_port,
      adb_server_socket,
      hexagon_debug,
      sysmon_profile,
      clear_logcat,
  ) -> HexagonLauncherRPC:
      """Initials and returns hexagon launcher which reuses RPC info and Android serial number."""
      android_serial_num = android_serial_number()
  
      if android_serial_num != [HEXAGON_SIMULATOR_NAME]:
          rpc_info = hexagon_server_process["launcher"]._rpc_info
      else:
          rpc_info = {
              "rpc_tracker_host": tvm_tracker_host,
              "rpc_tracker_port": tvm_tracker_port,
              "rpc_server_port": rpc_server_port,
              "adb_server_socket": adb_server_socket,
          }
      try:
          if android_serial_num == [HEXAGON_SIMULATOR_NAME]:
              launcher = HexagonLauncher(
                  serial_number=android_serial_num[0], rpc_info=rpc_info
              )
              launcher.start_server()
          else:
              launcher = HexagonLauncher(
                  serial_number=hexagon_server_process["device_adr"],
                  rpc_info=rpc_info,
                  hexagon_debug=hexagon_debug,
                  sysmon_profile=sysmon_profile,
                  clear_logcat=clear_logcat,
              )
          yield launcher
      finally:
          if android_serial_num == [HEXAGON_SIMULATOR_NAME]:
              launcher.stop_server()
          elif not hexagon_debug:
              launcher.cleanup_directory()
  
imports: import os
  import random
  from typing import Optional, Union
  import pytest
  import tvm
  import tvm.rpc.tracker
  from tvm.contrib.hexagon.build import HexagonLauncher, HexagonLauncherRPC
  from tvm.contrib.hexagon.session import Session
  from tvm.contrib.hexagon.tools import HEXAGON_SIMULATOR_NAME
label_desc: Use image node_id 15 for calling a global function with example usage: hexagon_launcher(hexagon_server_process, rpc_server_port, tvm_tracker_host, tvm_tracker_port, adb_server_socket, hexagon_debug, sysmon_profile, clear_logcat) without return types