For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/lynx-native-api/lynx-env.md.
Lynx
  • 简体中文
  • LynxEnv Desktop

    LynxEnv Desktop

    LynxEnv 是 Desktop public API 的进程级环境入口,负责暴露 SDK 信息、DevTool 开关、LogBox 开关,以及 Native Module / Extension Module 的注册能力。

    Desktop (C++)

    lynx::pub::LynxEnv& env = lynx::pub::LynxEnv::GetInstance();
    const char* version = env.GetVersion();
    env.SetDevtoolAppInfo("app_id", "demo");
    env.SetDevtoolEnabled(true);
    bool devtool_enabled = env.IsDevtoolEnabled();
    bool connected = env.ConnectDevtool("ws://127.0.0.1:9229");
    env.SetLogboxEnabled(true);
    bool logbox_enabled = env.IsLogboxEnabled();
    env.RegisterNativeModule("DemoModule", creator, opaque);
    env.RegisterExtensionModule("DemoExtension", extension_creator, true, opaque);

    LynxEnv

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。