reset_network_condition
Reset network conditions to default in a simulator for testing network-dependent applications.
Instructions
Resets network conditions to default in the simulator.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| simulatorUuid | Yes | UUID of the simulator to use (obtained from list_simulators) |
Implementation Reference
- src/tools/simulator.ts:697-708 (handler)The async handler function for the 'reset_network_condition' tool. It logs the action and calls executeSimctlCommandAndRespond to run the simctl command 'status_bar [uuid] clear' which resets the network conditions (and status bar) on the simulator.async (params: { simulatorUuid: string }): Promise<ToolResponse> => { log('info', `Resetting simulator ${params.simulatorUuid} network condition`); return executeSimctlCommandAndRespond( params, ['status_bar', params.simulatorUuid, 'clear'], 'Reset Network Condition', `Successfully reset simulator ${params.simulatorUuid} network conditions.`, 'Failed to reset network condition', 'reset network condition', ); },
- src/tools/simulator.ts:693-696 (schema)Zod input schema defining the simulatorUuid parameter for the tool.simulatorUuid: z .string() .describe('UUID of the simulator to use (obtained from list_simulators)'), },
- src/tools/simulator.ts:688-710 (registration)The registerResetNetworkConditionTool function that registers the tool on the MCP server, providing name, description, input schema, and handler.export function registerResetNetworkConditionTool(server: McpServer): void { server.tool( 'reset_network_condition', 'Resets network conditions to default in the simulator.', { simulatorUuid: z .string() .describe('UUID of the simulator to use (obtained from list_simulators)'), }, async (params: { simulatorUuid: string }): Promise<ToolResponse> => { log('info', `Resetting simulator ${params.simulatorUuid} network condition`); return executeSimctlCommandAndRespond( params, ['status_bar', params.simulatorUuid, 'clear'], 'Reset Network Condition', `Successfully reset simulator ${params.simulatorUuid} network conditions.`, 'Failed to reset network condition', 'reset network condition', ); }, ); }
- src/utils/register-tools.ts:354-357 (registration)Configuration object in toolRegistrations array that enables conditional registration of the reset_network_condition tool based on environment variable.register: registerResetNetworkConditionTool, groups: [ToolGroup.SIMULATOR_MANAGEMENT], envVar: 'XCODEBUILDMCP_TOOL_RESET_NETWORK_CONDITION', },