I was talking recently with Matt Wallace, the Nashville Flex User Group manager, about switching Flash Player versions in OS X. He had found Mike Chambers bash script but was having problems getting Mike's code to work. Matt eventually developed his own solution and while he did an excellent job his utility has a few annoyances that I don't want to deal with. I'm sure he'll get all these fixed but currently you must empty the trash to clear unwanted Flash Player files that appear every time you switch FP versions. You also have to edit his Automator script every time you want to add a new Flash Player to the switching ability.

So I dug into Mike's code to see why folks were having problems getting it running. I didn't have any issues but that's because I was able to figure out a few steps Mike left out. I also made his bash script a little better eliminating the need to create a linked file to get around bash's nuances with spaces in directory names.

What I came up with is not much different than what Mike originally created, it's just more refined. If you're interested in my version read on for download and installation instructions.

  1. Download the bash script here.
  2. Extract fpswitch.sh from the zip file and put it anywhere you want. I have mine stored in /Users/aaron
  3. Make the bash script executable by typing sudo chmod +x fpswitch.sh in the same directory where you put the script.
  4. Determine which Flash Player version you currently have installed by visiting this link.
  5. The Flash Player (for Safari and Firefox) is stored in the directory /Library/Internet Plug-Ins. Create a new directory in this location that matches the Flash Player version you currently have installed. For instance, if you have FP 9.0 installed create the directory 9.0 so you wind up with /Library/Internet Plug-Ins/9.0.
  6. There are two files used by Flash Player in Safari and Firefox: Flash Player.plugin and flashplayer.xpt. Copy both of these files to the new directory you created in the previous step.
  7. You can now download additional Flash Player versions, create the appropriate directory in /Library/Internet Plug-Ins and then copy the Flash Player files into the new directory. If you don't have Flash Player 10 installed, I recommend installing it so you can test the bash script. You can download Flash Player 10 from here. Once downloaded and installed create a new directory called 10.0beta in /Library/Internet Plug-Ins and copy the two Flash Player files into the new directory. Again, these are Flash Player.plugin and flashplayer.xpt located in /Library/Internet Plug-Ins.

Once you have at least two Flash Player versions installed you can test switching between them. Open Terminal (/Applications/Utilities), navigate to the directory that contains the downloaded bash script, and type ./fpswitch.sh 9.0 or ./fpswitch.sh 10.0beta. The second part of the call to the bash script is the exact name of the folder that contains the Flash Player plugin files. The script will generate output indicating success or failure.

After running the bash script launch your browser of choice and load up Adobe's Flash Player version testing page. You should see the appropriate Flash Player version you switched to. Head on back to Terminal and press the up arrow on your keyboard to show the previous Terminal command. Delete the directory name you have listed and type another one, like 10.0beta. Restart your browser and visit the Flash Player version testing page again. The page should indicate a new FP version is active.

With the bash script set up you can run any number of Flash Player versions you want and switch between them at will. Simply download the Flash Player version you need and follow step 7 above. This is incredibly handy for projects that require testing on one or more specific Flash Player versions. As a Flex developer I run the debug version of Flash Player quite a bit but this isn't necessarily the best version to use when simply browsing the web and not developing. With the bash script I can quickly switch to a non-debug version in seconds.

As Mike suggests on his blog post, you can wire up the Flex command-line compiler (mxmlc) with the bash script in order to test your Flex apps against a specific FP version. For a good mxmlc tutorial (Windows) check out this blog post.

Aaron West's Gravatar
About this post:

This entry was posted by Aaron West on June 13, 2008 at 8:00 AM. It was filed in the following categories: Flex, Mac, Flash. It has been viewed 8967 times and has 1 comments.

1 Responses to Switching Flash Player Versions in Seconds on Mac

  1. I've found a similar solution that applies to Mac, Windows and supposedly Linux as well.

    Credits goes to Matt Shaw:

    My opinion is shared here on my blog and a bit of instructions on how to set it up in Google Chrome: