Switch between instances of appium (iOS)

Hi,

I have created two instances of appium on two different mac machines
how to switch between the instances through java code

Thanks,
Sugumar