Added fork support to discovery and ios_wrapper