Xcode scripting for Corona

Hi there
I wrote some applescripts that can be imported into Xcode in order to Control the Corona Stimulator and terminal from Xcode (with shortcuts)
I thought they might be useful for others so I decided to post a download link here:

http://shakebrowser.net/xcode_scripts.zip

In the zip there is a pdf explaining how to import the scripts into xcode.

The zip file contains 11 scripts and below is a list of their names and what they do:

- Xcode Corona Terminal: Launches ”Corona Terminal” and opens the most recent project opened. If Corona Simulator is already running, it calls Corona/File/Open instead. (To use this script you have to be a registered Corona user, otherwise the trial pop up will block the open command. Se below)

- Xcode Corona Terminal Trial: Same script as above exept it clicks the continue button on the annoying Corona trial pop up window (sorry Corona). Use this if you are a trial user.

- Xcode Corona Relaunch: Relaunches Corona project in simulator.

- Xcode Clear Terminal: Removes all text in Terminal

- The 7 scripts in the ”Xcode view as” folder switches between the seven testing devices in Corona simulator.

You attach the scripts to keyboard shortcuts, and all the scripts returns focus to Xcode after completing task... so you can continue coding, without switching between Xcode and Corona Simulator all the time.

And BTW: You have to "Enable access for assistive devices" in the "System Preferences"/"Universal access" window in order to allow the scripts to do their magic.

Have fun, Ojnab

Wooot ....

C.

Very handy Ojnab.

Thanks :-)

Here is an applescript that installs your android apk's to device via usb.
It prompts a file browser and installs the apk you select.

It uses adb, so you have to have install the android sdk if you haven't already.

paste the code to the applescript editor and if you export it as an .scpt file you can import it to a shortcut in xcode as explained above. If you export the script as an .app file, you can use it by executing it.

Before exporting the script you have to change the paths (buildFolder and adbPath) to your own build folder and adb folder paths.

Hope this is usefull to someone.

[EDIT: typo in code]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
set buildFolder to "/builds"
set adbPath to "/Android/android-sdk-mac_x86/platform-tools/"
 
set apk to choose file with prompt "Choose .apk to install to device:" of type {"apk"} default location buildFolder
set apkPath to (the POSIX path of apk)
 
try
        set response to do shell script "cd " & adbPath & "; ./adb install " & apkPath
        if response contains "ALREADY_EXISTS" then
                set button to (display dialog "Do you want to replace existing file on the device?" with icon 2)
                if button = {button returned:"OK"} then
                        set response to do shell script "cd " & adbPath & "; ./adb install -r " & apkPath
                        complete(response, apkPath)
                end if
        else
                complete(response, apkPath)
        end if
        
on error errorDescription
        display dialog {errorDescription} as text buttons {"OK"}
end try
 
on complete(response, apkPath)
        if response contains "Success" then
                display dialog "Successfully installed: " & apkPath buttons {"OK"}
        else
                display dialog response buttons {"OK"}
        end if
end complete
views:1749 update:2011/10/18 15:01:22
corona forums © 2003-2011