How to record & replay iOS scripts on Mac 10.12.6

How to record & replay iOS scripts on Mac 10.12.6

Need step by step instructions for installation & script preparation

As of now am stuck at XCode coz XCode needs 10.13.2 which I cant install on my machine