簡體   English   中英

Eclipse:如何以編程方式執行啟動配置?

[英]Eclipse: How can I execute a launch configuration programmatically?

我的Eclipse項目中有各種啟動配置文件。 有什么方法可以以編程方式執行任意啟動配置嗎?

       ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();

       ILaunchConfigurationType type =     manager.getLaunchConfigurationType("org.eclipse.cdt.launch.applicationLaunchType");
       ILaunchConfiguration[] lcs = manager.getLaunchConfigurations(type);

            for (ILaunchConfiguration iLaunchConfiguration : lcs) {
                if (iLaunchConfiguration.getName().equals("Test PThread")) {
                    ILaunchConfigurationWorkingCopy t = iLaunchConfiguration.getWorkingCopy();
                    ILaunchConfiguration config = t.doSave();
                    if (config != null) {
                        // config.launch(ILaunchManager.RUN_MODE, null);
                        DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
                    }
                }
            }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM