JamesG
JamesG

Reputation: 1601

Swift: Change Simulator Location programmatically

I am looking for a way to change the Simulator location programatically.

I know that I can Use a GPX file and then select it in the Xcode teleport option however this is not what I want.

There seems to be either little information or a definite answer if this is possible and I am struggling to think of solutions.

Can anyone help?

If I have to create several GPX files and then switch them programmatically that is fine.

Upvotes: 1

Views: 1482

Answers (2)

levous
levous

Reputation: 942

While setting from code is not available, there is a CLI tool set_simulator_location that works great for development testing

Upvotes: 0

torinpitchers
torinpitchers

Reputation: 1292

Im afraid there is no easy way to do this. This has been asked quite a lot and you can see other posts with the same answers.

The best way you can automate this is to:

  1. create all the GPX files you need with the different locations

  2. create a build script that selects the appropriate one

  3. use a build server to build the product and run the XCTests for each one

You can search high and low and you will end up with a variation of this method. Good luck! :)

Upvotes: 2

Related Questions