Finally, place down a rail somewhere near the command block and place a minecart on the rail. It should disappear, teleporting above the ender dragon.
Note: This will not work unless the ender dragon and minecart are in range of the command block placed.
Additional Note: On Pocket Edition/Windows 10, I encountered a bug where the ender dragon became invisible when using this trick. I do not know If the bug is still intact.