3

I want to duplicate target of Xcode project with command line, I have searched a lot but not found any solution. I don't have any idea how to write script to duplicate target.

Can anyone help me?

Thanks in advance

5
  • I don't see how a script will do what you want. You'll have to do it manually. Commented Jul 28, 2014 at 6:53
  • Is there any documentation where it is mentioned that we can not duplicate target? Commented Jul 28, 2014 at 7:02
  • Doubtful; documentation normally covers features, not lack of features. Commented Jul 28, 2014 at 7:04
  • Ok thanks, But i need proof :) Commented Jul 28, 2014 at 7:22
  • Why down voted? Please give me the reason Commented Jul 28, 2014 at 8:51

1 Answer 1

5

Please see the code, it worked for me:

tell active workspace document
    set my_project to (get first project)
    tell my_project


        tell application "System Events"
            keystroke "d" using {command down}
            delay 0.5
            tell application process "Xcode"
                --delay 1.0E-3

                click button "Duplicate Only" of window 1


            end tell

        end tell

    end tell
end tell
end tell
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.