2

After building, FlashDevelop will run this in Project > Properties > Build > Post-Build Command Line:

"$(ProjectDir)\debug-android.bat"

The bat file will install my game on my phone. It's supposed to run only on Android target. But it also runs on Flash target. So how to disable it on Flash target?

Dlean Jeans
  • 966
  • 1
  • 8
  • 23

1 Answers1

2

You could pass the TargetBuild variable to your .bat file:

$(ProjectDir)\debug-android.bat $(TargetBuild)

Then simply exit early if the argument value is not android:

if not %1 == android goto :eof

echo Running on android

Check Project -> Properties -> Build -> Builder... for all available variables and their current value.

Gama11
  • 31,714
  • 9
  • 78
  • 100
  • You can also create separate batch files for each target: `$(ProjectDir)\debug-$(TargetBuild).bat` – Mark Knol Jan 28 '16 at 08:57
  • Nice idea! However, it doesn't really suit this particular use case too well. – Gama11 Jan 28 '16 at 09:05
  • @MarkKnol Actually, I only need the game installed on Android platform. The other platform is Flash which doesn't need to be installed on. – Dlean Jeans Jan 28 '16 at 09:06
  • Nevermind. After a while, I learn how to add a line to check if the "%1" argument is null or blank. If it's true, it will skip your line. – Dlean Jeans Jan 28 '16 at 09:27