MCPcopy
hub / github.com/zai-org/Open-AutoGLM / main

Function main

main.py:684–849  ·  view source on GitHub ↗

Main entry point.

()

Source from the content-addressed store, hash-verified

682
683
684def main():
685 """Main entry point."""
686 args = parse_args()
687
688 # Set device type globally based on args
689 if args.device_type == "adb":
690 device_type = DeviceType.ADB
691 elif args.device_type == "hdc":
692 device_type = DeviceType.HDC
693 else: # ios
694 device_type = DeviceType.IOS
695
696 # Set device type globally for non-iOS devices
697 if device_type != DeviceType.IOS:
698 set_device_type(device_type)
699
700 # Enable HDC verbose mode if using HDC
701 if device_type == DeviceType.HDC:
702 from phone_agent.hdc import set_hdc_verbose
703
704 set_hdc_verbose(True)
705
706 # Handle --list-apps (no system check needed)
707 if args.list_apps:
708 if device_type == DeviceType.HDC:
709 print("Supported HarmonyOS apps:")
710 apps = list_harmonyos_apps()
711 elif device_type == DeviceType.IOS:
712 print("Supported iOS apps:")
713 print("\nNote: For iOS apps, Bundle IDs are configured in:")
714 print(" phone_agent/config/apps_ios.py")
715 print("\nCurrently configured apps:")
716 apps = list_ios_apps()
717 else:
718 print("Supported Android apps:")
719 apps = list_supported_apps()
720
721 for app in sorted(apps):
722 print(f" - {app}")
723
724 if device_type == DeviceType.IOS:
725 print(
726 "\nTo add iOS apps, find the Bundle ID and add to APP_PACKAGES_IOS dictionary."
727 )
728 return
729
730 # Handle device commands (these may need partial system checks)
731 if handle_device_commands(args):
732 return
733
734 # Run system requirements check before proceeding
735 if not check_system_requirements(
736 device_type,
737 wda_url=args.wda_url
738 if device_type == DeviceType.IOS
739 else "http://localhost:8100",
740 ):
741 sys.exit(1)

Callers 1

main.pyFile · 0.70

Calls 15

runMethod · 0.95
resetMethod · 0.95
set_device_typeFunction · 0.90
set_hdc_verboseFunction · 0.90
list_supported_appsFunction · 0.90
ModelConfigClass · 0.90
IOSAgentConfigClass · 0.90
IOSPhoneAgentClass · 0.90
AgentConfigClass · 0.90
PhoneAgentClass · 0.90
get_device_factoryFunction · 0.90
parse_argsFunction · 0.70

Tested by

no test coverage detected