FlexMojos, Mac OSX and the Stand Alone Flash Player Debugger
I recently struggled with getting a flexmojos-based project to successfully find the stand alone Flash Player Debugger during the testing phase of my build.
Let me say first that on my linux system this was not an issue – I simply placed the flash player executable on my path as flashplayer and FlexMojos was happy to fire it up and run my FlexUnit tests. This was also the case on my Windows machine. But of course, I love my new shinny 17″ PowerBook so finding a solution to the pesky error below became a priority.
[WARNING] [LAUNCHER] Using regular flashplayer tests
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to launch Flash Player. Probably java was not able to find flashplayer.
Make sure flashplayer is available on PATH
or use -DflashPlayer.command=${flashplayer executable}
Read more at: https://docs.sonatype.org/display/FLEXMOJOS/Running+unit+tests
I tried a couple different approaches, stringing together bits and pieces of information from various sources but I eventually arrived at the following configuration.
First, Install the Flash Player Debugger your /Applications directory. Find the Flash Player Debugger in ${FLEX_HOME}/runtimes/player/10.1/mac/Flash Player Debugger.app.zip
Second, utilize the FlexMojo configuration option flashPlayerCommand to configure the mojo so it will look for the Flex Player Debugger on the path as “flashplayer” Feel free to use whatever alias you want here – you’ll reference it in step 3.
<!--My project pom's Flexmojos3.7.1 configuration-->
<flashPlayerCommand>flashplayer</flashPlayerCommand>
Last, from within /Applications/Flash\ Player\ Debugger.app/Contents/MacOS directory, symlink Flash Player Debugger to your decided upon alias (“flashplayer”)
ln -s Flash Player Debugger flashplayer
* I tried just setting Flex Mojo’s flashPlayerCommand option to “Flash Player Debugger” the mojo seemed to ignore that…something to look into that would keep us from having to do #3
* I tried symllinking to FlashPlayerDebugger from an external location that was on my path is ~/mybin/ flashplayer -> /Applications/Flash\ Player\ Debugger.app/Contents/MacOS/Flash\ Player\ Debugger but that resulted in the player not closing to the mojos liking after the test executed.
* Let me know if there is a different approach that you find…something cleaner
FWIW I was only able to get this to work by creating a bash script at /usr/bin/flashplayer containing
“/path/to/app/Flash Player Debugger” $@