Anirudha Mahale
Anirudha Mahale

Reputation: 2596

How to stop Xcode simulator draining network data

Every time I open Xcode Simulator it invokes an activity called nsurlsessiond and it drains my network data. I just open simulator, I don't even make any api calls still it drains my network data.

I have restricted 1.5GB per day

The Xcode version is Version 11.2.1 (11B53).

I had deleted some of the simulators which I am not using.

Previously simulator wasn't draining data like this. Can anyone tell me why this is happening.

enter image description here

I got this output from the tcpDump file using Wireshark. enter image description here

Upvotes: 6

Views: 1700

Answers (2)

wandersage
wandersage

Reputation: 11

you could use bash script below which kills nsurlsessiond process. just copy it to *.sh file and run in terminal when you want to restrict nsurlsessiond activity.

#!/bin/sh

while true; 
do 
    pid=$(pgrep "nsurlsessiond");
    if [[ ! -z "$pid" ]]; then
        echo "nsurlsessiond with PID:${pid} killed at $(date +'%X')";
        echo $(pkill "nsurlsessiond");
    fi
    sleep 10;
done

Upvotes: 1

Madhav Nasit
Madhav Nasit

Reputation: 111

Finally i find a temporary solution!

rename the file com.apple.nsurlsessiond(Dont delete) in

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/UserEventPlugins/com.apple.nsurlsessiond.plugin/

to something -com.apple.nsurlsessiond

and also the file nsurlsessiond(Dont delete) in

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/libexec/

to something -nsurlsessiond

Upvotes: 6

Related Questions