Welcome to the CrackBerry Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 24 of 24
Like Tree3Likes
  • 2 Post By mikelcal
  • 1 Post By NaijaBerry
  1. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #1  

    Default 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

    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
    If you prefer, download the applescript below and edit it with AppleScript.

    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.
    Attached Files Attached Files
    Last edited by mikelcal; 01-09-2012 at 03:51 PM.
    Thanked by 5:
    brettbristow22 (02-28-2012),  CanadianThomas (01-09-2012),  jaydee5799 (04-15-2012),  lmsc88 (08-30-2012),  rob7100g (01-09-2012) 
  2. rob7100g's Avatar
    CrackBerry Abuser

    Posts
    298 Posts
    #2  

    Default Thank you!

    Hi Mike,

    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.

    -- Robert.
    Attached Files Attached Files
    Thanked by:
    mikelcal (01-09-2012) 
  3. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #3  

    Default

    Quote Originally Posted by rob7100g View Post
    Hi Mike,

    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.

    -- Robert.
    no, thank you for the kind words! l'll work some more on this later on today.
  4. solidkundi's Avatar
    CrackBerry Newbie

    Posts
    1 Posts
    #4  

    Unhappy

    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
  5. Sergag's Avatar
    CrackBerry User

    Posts
    92 Posts
    #5  

    Default

    I have that line in the Terminal...

    "Unable to access jarfile BarDeploy.jar"

    So the sideload doesn't work, question, were is that BarDeploy.jar file. Thanks.
  6. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #6  

    Default

    Quote Originally Posted by solidkundi View Post
    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
    I do apologize, I should write a proper How-To. After you download the script, you actually have to "right-click" the file and open with applescript editor and change the lines of code where your PB tools folder is saved. Also you have to edit it to reflect your developer IP/Password. If your PB and laptop are connected to wifi using the same network, you dont even need to connect to USB!! after that is done hit save and you can drag and drop any bar file on the app. Hope this helps.
  7. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #7  

    Default

    Quote Originally Posted by Sergag View Post
    I have that line in the Terminal...

    "Unable to access jarfile BarDeploy.jar"

    So the sideload doesn't work, question, were is that BarDeploy.jar file. Thanks.
    It should be in the Playbook_Tools folder you have to edit the line where it changes directories to the PB tools folder. If you dont have them, I just uploaded the zip file.
  8. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #8  

    Default

    Thanks everyone for your comments so far. I will work on an even easier way to sideload apps to your PB on a Mac.
  9. Sergag's Avatar
    CrackBerry User

    Posts
    92 Posts
    #9  

    Default

    Ok, I've downloaded the java lib and now it work, big thanks, no need to pass by Windows anymore.
    Last edited by Sergag; 01-09-2012 at 04:18 PM.
  10. CanadianThomas's Avatar
    CrackBerry Addict

    Posts
    535 Posts
    PIN
    PM me
    #10  

    Default

    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.

    Thanks.

    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.
    follow my switch from iOS to BlackBerry: http://canadianthomas.wordpress.com/
  11. CanadianThomas's Avatar
    CrackBerry Addict

    Posts
    535 Posts
    PIN
    PM me
    #11  

    Default

    Anyone have an issue with file names with spaces? I'll check into it further.
    follow my switch from iOS to BlackBerry: http://canadianthomas.wordpress.com/
  12. BigRed65's Avatar
    CrackBerry Newbie

    Posts
    2 Posts
    #12  

    Default

    Hello,

    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
    delay 10
    end tell
    end repeat
    end open

    if filecount < 1 then
    tell application "Terminal"
    do script "exit"
    end tell
    Thanked by:
    mikelcal (02-11-2012) 
  13. mikelcal's Avatar
    CrackBerry Abuser

    Posts
    485 Posts
    Global Posts
    491 Global Posts
    Thread AuthorThread Author   #13  

    Default

    Quote Originally Posted by BigRed65 View Post
    Hello,

    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
    delay 10
    end tell
    end repeat
    end open

    if filecount < 1 then
    tell application "Terminal"
    do script "exit"
    end tell
    Thanks BigRed! This is great!
  14. BerryClever's Avatar
    CrackBerry Addict

    Posts
    543 Posts
    #14  

    Default

    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"
  15. BerryClever's Avatar
    CrackBerry Addict

    Posts
    543 Posts
    #15  

    Default

    The thread is probably dead, but incase anyone else has the issues I had. It was a password issue, I used a password for the device, and a different password for sharing. I made them both the same, and it worked for me.
  16. NaijaBerry's Avatar
    CrackBerry Addict

    Posts
    921 Posts
    Global Posts
    923 Global Posts
    #16  

    Default

    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
    cd /Users/Username/Playbook_Tools/lib
    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)
    Thanked by 2:
    eamon10 (04-01-2012),  retep (03-12-2012) 
    eamon10 likes this.
  17. D_Town's Avatar
    CrackBerry Addict

    Posts
    535 Posts
    #17  

    Default

    still getting the bar error...:-(
    Now you know, and knowing is half the battle. G. I Joe

    LETS GO REDWINGS. CLAP! CLAP! CLAP! CLAP! CLAP!
  18. Denus's Avatar
    CrackBerry Abuser

    Posts
    111 Posts
    #18  

    Default

    Hi all,

    I'm trying to compile the applescript, but I get this error message: "Syntax Error, Expected end of line but found end of script".
    I did copy the script as shown in this thread.
    What's the issue here?

    Thanks!
    Attached Thumbnails Attached Thumbnails Simple way to load PlayBook Bars on Mac: Introducing oBarLoad-screen-shot-2012-03-05-9.25.28-am.png  
  19. Denus's Avatar
    CrackBerry Abuser

    Posts
    111 Posts
    #19  

    Default

    Well, I managed to do the install with the .bat file on my Windows partition (dual boot is handy).
  20. eamon10's Avatar
    CrackBerry Newbie

    Posts
    2 Posts
    #20  

    Default

    please help keep getting this "Unable to access jar file BarDeploy.jar"
    I've tried everything put in the correct path and everything.
  21. eamon10's Avatar
    CrackBerry Newbie

    Posts
    2 Posts
    #21  

    Default

    Quote Originally Posted by Olukunlea View Post
    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
    cd /Users/Username/Playbook_Tools/lib
    and it worked then.

    Thanks for the Mac Script much faster to install than on windows which i have to borrow to use!
    this is genius. thank you soooo much it finally worked
  22. troyante's Avatar
    CrackBerry Newbie

    Posts
    1 Posts
    #22  

    Default 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
  23. Sammity's Avatar
    CrackBerry Newbie

    Posts
    1 Posts
    #23  

    Default

    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!
  24. b1g1an's Avatar
    CrackBerry User

    Posts
    28 Posts
    #24  

    Default

    I only needed to put the "lib" on the end for mine to work...and then the time it took to realise I needed to remove the spaces from the file names!


    Sent from my BlackBerry Runtime for Android Apps using Tapatalk 2

Posting Permissions