37

I have Eclipse Juno SR1 and Android SDK Tools 21.1, SDK Platform-tools 16.0.2 (latest) on Mac.

When I have some XML file selected and hit Run button, nothing happens. I have to select some Java File or project in the Package Explorer. Then it runs. It's quite annoying when I edit XML files. It was working in previous releases of Android SDK Tools.

Anyone knows any solution or workaround?

David Vávra
  • 18,446
  • 7
  • 48
  • 56

1 Answers1

82

I think its due to some recent changes in ADT 21.1.0. Anyhow, to resolve this, you may configure the following in Eclipse:

Window -> Preferences -> Run/Debug -> Launching -> (under Launch Operations) Always launch the previously launched application

In case you want to open another project, then you need to revert this process as it will always launch the previously launched application.

Also, keep in mind that this issue may be fixed in the future versions of ADT, so don't rely hard on this solution.

waqaslam
  • 67,549
  • 16
  • 165
  • 178
  • 4
    Good answer...you beat me to it! :) But I don't necessarily agree with "revert" the process to open another project. If its the first time running it, you will need to right-click the project and select run but after that it should be under "Run" at the top. So if you want to run a previously ran project you can select it from there. Then it will keep running that one until you select another. Hope that made sense, it did in my head but I'm really tired :P – codeMagic Mar 11 '13 at 13:08
  • @codeMagic Yes, right-clicking on the project and select Run as Android project may also help in not to revert this process and will make the new application as 'the last launched app'. Thanks for the input :) – waqaslam Mar 11 '13 at 13:13
  • Great answer! Saves a lot of clicks! It's even more useful than running currently selected file, because my app consists of multiple library projects. I want to run the app, not the library project I'm currently editing. – David Vávra Mar 12 '13 at 09:12
  • 3
    You are, at this minute, my favorite human ever. This has bugged me for longer than I care to admit. – Brian Dupuis Apr 25 '13 at 18:13
  • Surprisingly, as of April 2014, this hasnt been fixed. Go Eclipse! – katzenhut Apr 08 '14 at 13:10
  • Not fixed in latest ADT as of Aug 2014 – faizal Aug 17 '14 at 03:52
  • This is an answer can make like ADT to and .NET developer. – Teoman shipahi Nov 23 '14 at 19:23