Last Updated: February 25, 2016
·
1.373K
· chrishale

Browser Stack - quick command line tunnelling

Here's a neat time saver for loading up the new browser stack command line tunnel with local Apache sites. Providing you format your vhosts in the following way; example.dev ~> ~/Sites/example this should save you a bit of time.

Go ahead and download the new BrowserStackTunnel.jar from browserstack.com and stick it somewhere like your ~/Sites folder.

Hide it so you don't have to worry about it cluttering your folders;

$ chflags hidden ~/Sites/BrowserStackTunnel.jar

Edit your .bash_profile replacing |your private key|:

alias bs="open http://browserstack.com/; java -jar ~/Sites/BrowserStackTunnel.jar |your private key| ${PWD##*/}.dev,80,0"

If you are a zsh user, edit your .zshrc instead replacing |your private key|:

bs () {
 open http://browserstack.com/ && java -jar ~/Sites/BrowserStackTunnel.jar |your private key| ${PWD##*/}.dev,80,0
}

Now, you can cd to your project folder, open a new tab in terminal and run bs.

Rejoice!

1 Response
Add your response

Any suggestions on how to skip the 'opening a new tab' step would be appreciated. Aliases seem to be evaluated when you launch Terminal rather than when executed

over 1 year ago ·