Launch iPhone 4 simulator from terminal?

I’d like to know if it’s possible to launch the terminal with a folder argument in the iPhone 4 simulator? Like using: “/Applications/Corona\ Game\ Edition\ 2010.109/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator /my/folder/to/my/game” but having it launch in the iPhone 4 simulator?

Is there some sort of argument for it? I need help as soon as possible, thanks! [import]uid: 9033 topic_id: 4232 reply_id: 304232[/import]

I think this is possible, because TextMate is doing this. Here’s the command from the CoronaSDK bundle for TextMate:

<?xml version="1.0" encoding="UTF-8"?>



beforeRunningCommand
saveModifiedFiles
command
#!/bin/bash

CORONA_SIM_PATH="/Applications/CoronaSDK/simulator"

# In order for the simulator relaunch to work, “Enable access for assistive devices” must be selected in System Preferences > Universal Access.

osascript <<- APPLESCRIPT

on appIsRunning(appName)
tell application “System Events” to (name of processes) contains appName
end appIsRunning

on selectAppMenuItem(app_name, menu_name, menu_item)
try
– bring the target application to the front
tell application app_name
activate
end tell
tell application “System Events”
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
click menu item menu_item
end tell
end tell
end tell
end tell
end tell
return true
on error error_message
return false
end try
end selectAppMenuItem

if appIsRunning(“Corona Simulator”) then
selectAppMenuItem(“Corona Simulator”,“File”,“Relaunch”)
else
tell application “Terminal”
do script “$CORONA_SIM_PATH $TM_DIRECTORY”
end tell
end if

APPLESCRIPT
input
none
keyEquivalent
@r
name
Run Simulator
output
discard
scope
source.lua
uuid
1831E774-8AF9-4EF0-BE93-11B077CC4DC2


[import]uid: 6795 topic_id: 4232 reply_id: 13135[/import]

From what I understand you can NOT specify the device to launch via the command line – at present. But I hear through the grapevine that functionality is coming (hopefully soon).

Jay
[import]uid: 9440 topic_id: 4232 reply_id: 13136[/import]

Dang :confused: I wanted to do this because I use corona project manager, and I was going to write a shell script to launch using the iphone 4 instead of the iphone. I hope they add it soon, cause that instantly turned my experience with CPM from a 5/5 to a 2/5 (it’s VERY important to be able to test my game with the iPhone 4) [import]uid: 9033 topic_id: 4232 reply_id: 13140[/import]

This afternoon I played around with handling the device selection via AppleScript after the simulator launches. If choosing the device via the command line is NOT in the next release of Corona SDK (within the next few days), I’ll add that into Corona Project Manager right away.

I know there are some people doing iPad apps using CPM that would really that feature, too.

Jay [import]uid: 9440 topic_id: 4232 reply_id: 13149[/import]

eMpire - can you send me an email at j@jawhye.com – I might have something for you.

Jay

PS - To the forum folks at Ansca - a way to “private message” or email other users would be cool.

PPS - As far as that goes, do you *really* want to be in the business of coding an online forum? :slight_smile:
[import]uid: 9440 topic_id: 4232 reply_id: 13164[/import]

done [import]uid: 9033 topic_id: 4232 reply_id: 13166[/import]

eMpire,

Can you share with me also? Neoinc@mac.com [import]uid: 36395 topic_id: 4232 reply_id: 24158[/import]