2012-03-20 2 views
0

일정에 따라 시뮬레이터에서 프로젝트를 시작하기 위해 AppleScript를 작성하고 싶습니다. 다음 사과 스크립트를 사용하고 있지만 시뮬레이터에서 프로젝트를 실행하지 않습니다. 시뮬레이터를 종료하고 XCODE를 시작하지만 대상이 시뮬레이터로 올바르게 설정되었지만 시뮬레이터에서 프로젝트를 실행하지 마십시오. 어떻게해야합니까?사과 스크립트를 사용하여 시뮬레이터 빌드 실행하기

application "iPhone Simulator" quit 
tell application "Xcode" 
    open "Users:abhinav:myProject:Code:client:src:test.xcodeproj" 
    tell project "test" 
     clean 
     build 
     run 
    end tell 
end tell 
application "iPhone Simulator" activate 

답변

0

불행히도 Xcode의 AppleScript 지원은 매우 손상되어 실행 동사를 지원하지 않습니다. 그러나 AppleScript를 사용하는 경우 다음과 같은 코드로 시스템 이벤트를 사용하여 실행할 수 있습니다.

tell application "Xcode" 
    tell project "test" 
     activate 
    end tell 
end tell 


tell application "System Events" 
    tell process "Xcode" 
     click menu item "Run Without Building" of menu 1 of menu item "Perform Action" of menu "Product" of menu bar item "Product" of menu bar 1 
    end tell 
end tell 
관련 문제