在 Eclipse 中添加应用程序启动快捷方式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3430710/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:58:24  来源:igfitidea点击:

Add application launch shortcut in Eclipse?

androideclipsekeyboard-shortcutshotkeysautostart

提问by Brad Hein

I've been programming Android in Eclipse for about a year now and I have always launched my app by right clicking on my project name in the project explorer, followed by "run as", then "Android Application". There has to be a better way...

我已经在 Eclipse 中编写 Android 大约一年了,我总是通过在项目资源管理器中右键单击我的项目名称来启动我的应用程序,然后是“运行方式”,然后是“Android 应用程序”。一定有更好的方法...

Is there a way to change this (three mouse clicks):

有没有办法改变这个(点击三下鼠标):

"Right click on project" -> "run as" -> "Android Application"

"Right click on project" -> "run as" -> "Android Application"

To this (one hotkey press):

为此(按一个热键):

<My favorite hotkey>

<My favorite hotkey>

So I can just press one button to launch my app?

所以我可以只按一个按钮来启动我的应用程序吗?

Thanks!

谢谢!

采纳答案by krock

In preferences, go to General -> keys and search for the Android Application command. You can set a new key combination from here.

在首选项中,转到 General -> keys 并搜索 Android Application 命令。您可以从这里设置新的组合键。

回答by Bruiser

  1. Eclipse/Window > Preferences > Run/Debug > Launching
  2. Select 'Always launch the previously launched application' in the 'Launch Operation' section.
  3. Then just use your shortcut of choice. I think Ctrl + F11 is the default for this
  1. Eclipse/Window > Preferences > Run/Debug > Launching
  2. 在“启动操作”部分中选择“始终启动之前启动的应用程序”。
  3. 然后只需使用您选择的快捷方式。我认为 Ctrl + F11 是默认设置

回答by Geert Weening

On MacOSX, for me worked Cmd+Shift+F11, which came down on laptop keyboard to Cmd+fn+Shift+F11

在 MacOSX 上,对我来说是Cmd+ Shift+ F11,它在笔记本电脑键盘上变成了Cmd+ fn+ Shift+F11

回答by Booger

I am not sure why the last answer is voted down, as I think it is the best answer. In the standard ADT Eclipse tool bar, there is the following button: enter image description here

我不确定为什么最后一个答案被否决,因为我认为这是最好的答案。在标准的 ADT Eclipse 工具栏中,有以下按钮:在此处输入图片说明

If you are editing a Java file, and press this button, your app will automatically be launched. Thus, this is one the one button press to launch your app.

如果您正在编辑 Java 文件,并按下此按钮,您的应用程序将自动启动。因此,这是一键启动您的应用程序的按钮。

As with the other shortcuts mentioned here, this does not work if you are editing an XML file (so ensure your editor is showing a Java file).

与此处提到的其他快捷方式一样,如果您正在编辑 XML 文件,这将不起作用(因此请确保您的编辑器显示的是 Java 文件)。

回答by muneebahmad

1) Eclipse/Window > Preferences > Run/Debug > Launching

1) Eclipse/Window > Preferences > Run/Debug > Launching

2) Select 'Always launch the previously launched application' in the 'Launch Operation' section.

2) 在“启动操作”部分中选择“始终启动之前启动的应用程序”。

3) Then just use your shortcut of choice. I think Ctrl + F11 is the default for this

3)然后只需使用您选择的快捷方式。我认为 Ctrl + F11 是默认设置

Someone suggested the above and it worked for me!

有人提出了上述建议,它对我有用!

回答by Amir

If you want to run your app when a XML file is open in your eclipse you must set your run configuration Eclipse -> run -> run configuration -> Android Application in left window -> your configuration -> android tab in right window -> launch -> select your main activity

如果要在 Eclipse 中打开 XML 文件时运行应用程序,则必须设置运行配置 Eclipse -> 运行 -> 运行配置 -> 左侧窗口中的 Android 应用程序 -> 您的配置 -> 右侧窗口中的 android 选项卡 ->启动 -> 选择您的主要活动

回答by Nandha Kumar

For this you can use (ctrl+F11) , which shows all online devices which is used as emulator

为此,您可以使用 (ctrl+F11) ,它显示用作模拟器的所有在线设备

回答by Jaakl

Eclipse toolbar has green run button which has default meaning run last selected configuration. Just click there.

Eclipse 工具栏有绿色的运行按钮,默认意思是运行上次选择的配置。只需点击那里。