Simple way to load PlayBook Bars on Mac: Introducing oBarLoad
Inspired by the legendary BlackBerry PlayBook warrrior HaTaX's post here and the recent surge of converted android apps, I too created a simple way to load PlayBook .bar files from my mac using a simple AppleScript I'd like to call oBarLoad. I'm in no way a developer, nor coder, but I do find that I am an excellent researcher
This script requires that you edit a few lines of code, and assumes that you already have a "PlayBook_Tools" folder somewhere on your harddrive and that you know how to put your PB in Developer mode. If you know a way to add a user interface to this script, by all means let me know how to do it so that I can update the script and thread with all the relevant files needed.
If you are familiar with AppleScript, just fire up the AppleScript editor and paste in this code
set filecount to 0 on open loadbar repeat with i in loadbar set filecount to 1 tell application "Terminal" set currentTab to do script "cd /Users/username/directory/Playbook_Tools" -- replace what is inside the quotes with the directory where you have Playbook Tools set filename to POSIX path of i do script "java -Xmx512M -jar \"BarDeploy.jar\" -installApp -device 127.0.0.1 -password passwordhere " & filename in currentTab -- change 127.0.0.1 to your actual developer ip found in the status bar of your pb, also change passwordhere to your actual password do script "exit" in currentTab delay 10 end tell end repeat end open if filecount < 1 then tell application "Terminal" do script "exit" end tell end if
Hit compile in AppleScript and save it as an .app you can then drag your .bar files to the icon and watch the magic unfold. Yes, I said files, you can drag multiple files to oBarLoad to sideload multiple .bar files simultaneously!
[b]*NOTE*[b] You have to edit the script to tell it where your PlayBook-Tools folder is and what your developer ip/password are. I'm still researching how to make it so that you don't have to edit the script and instead have it ask you for the ip and password.
I hope someone finds it useful.
Last edited by mikelcal; 01-09-2012 at 03:51 PM.
- CrackBerry Abuser
01-09-2012, 02:32 AM #2
- 298 Posts
Excellent job, thanks!
I had to point to the Playbook_Tools lib folder (attached) to get it to work. Once done everything worked.
FWIW I find it easiest to put the bar files in the Playbook_Tools folder as well.
- 01-09-2012, 11:40 AM #4
woww... good work sir...
but i'm a n00b when it comes to playbook stuff...
can you please specify a step procedure... so you won't be asked these questions...
I'm guessing you >> plug in usb >> development mode on >> drag bar to app(script)?
i didn't understand the part about the username / password file... if someone can please help... it'll be greatly appreciated
- CrackBerry Addict
01-09-2012, 10:09 PM #10
- 535 Posts
- PM me
cool script, thanks. I use the terminal but this is good for those who are shy of the old school text command.
OP. I think if you pulled this script in to automator, you could add the ability to have a pop up for filling in the info. Maybe one at a time?
But once a person edits the info for themselves, and sets their router to give the playbook a static IP address, it makes for a great desktop drop application. Good job.
My advice to all is to make your router give your playbook the same IP (static) then place your PlayBook_tools in your documents. This way you can edit this script once and it will always work.
Last edited by CanadianThomas; 01-09-2012 at 11:22 PM.
- 02-07-2012, 05:51 PM #12
Here is what I did to provide prompts into the initial scripts. I make no guarantee, the last version loaded, but I was having variable substitution errors with the do script with the collected data for some reason.
You need to change the location variables too. I blanked mine out in the script - current tab
property passwd : ""
property pbip : ""
set ipd to ""
set pass to ""
set pass to display dialog "Enter your debug password" default answer pass
set passwd to text returned of pass
set ipd to display dialog "Enter your playbook IP" default answer ipd
set pbip to text returned of ipd
display dialog passwd & " " & pbip
set filecount to 0
on open loadbar
repeat with i in loadbar
set filecount to 1
tell application "Terminal"
set currentTab to do script "cd /Users/username/location/Playbook_Tools" -- replace what is inside the quotes with the directory where you have Playbook Tools
set filename to POSIX path of i
-- do script "java -Xmx512M -jar \"BarDeploy.jar\" -installApp -device 127.0.0.1 -password passwordhere " & filename in currentTab -- change 127.0.0.1 to your actual developer ip found in the status bar of your pb, also change passwordhere to your actual password
do script "java -Xmx512M -jar \"BarDeploy.jar\" -installApp -device " & pbip & " -password" & passwd & " " & filename in currentTab -- change 127.0.0.1 to your actual developer ip found in the status bar of your pb, also change passwordhere to your actual password
do script "exit" in currentTab
if filecount < 1 then
tell application "Terminal"
do script "exit"
- CrackBerry Addict
02-22-2012, 07:07 PM #14
- 543 Posts
I apologize for bringing back this thread, but it is the most helpful so far. I am still having trouble side loading through my mac though. I think maybe it has to do with the ip address. Clicking the dev. icon on the home screen I get 2 IP address. Do I use the first or the second? I am tweaking what I am doing, and each time I get a different error message. The last time was "Error: Authentication failed. There have been 2 out of 5 attempts"
- 02-28-2012, 04:59 AM #16
I had issues with the "Unable to access jarfile BarDeploy.jar"
So i added the location of that file at the end of the path like this
and it worked then.
Thanks for the Mac Script much faster to install than on windows which i have to borrow to use!Aim at heaven and you will get earth thrown in. Aim at earth and you get neither.
C. S. Lewis (Mat 6:33)
- 08-05-2012, 12:45 PM #22
i can get it to work on mac
first of all my terminal message is this
admins-MacBook-Pro:~ admin$ then i try to add the
java -Xmx512M -jar BarDeploy.jar -installApp -device PLAYBOOK_IP -password PB_PASSWORD appname.bar
and then it says
the it says Unable to access jarfile BarDeploy.jar
- 08-27-2012, 05:31 PM #23
Looks like I'll be reviving this dead thread sorry!
First of all, thanks to the OP for taking the time to share his applescript it is much appreciated.
But I also had slight problems with the applescript on my computer, I edited the initial directory line from :
set currentTab to do script "cd /Users/username/directory/Playbook_Tools"
to the following
set currentTab to do script "cd Playbook_Tools/lib"
This is because when I open terminal I 'm already in my user directory.
After this it was all working, happy days!