Developer / DVT¶
DVT (DTX Instruments) services power the developer dvt CLI commands. On iOS 17+ they require a
tunnel-backed service provider — see iOS 17+ tunnels.
Each instrument is constructed with a DvtProvider (e.g. DvtProvider(service_provider)), used as
an async context manager; several instruments are async-iterable and yield telemetry/events.
Provider¶
pymobiledevice3.services.dvt.instruments.dvt_provider.DvtProvider ¶
Bases: DtxServiceProvider
Provides access to the DVT (DTX Instruments) services exposed by Apple's
instruments daemon.
The provider opens a DTXConnection on top of a
given service provider and is the entry point used by the individual DVT
DTXService subclasses (process control, device
info, screenshot, etc.).
The underlying service is reached differently depending on the transport:
- over lockdown (
SERVICE_NAME/OLD_SERVICE_NAME) on older iOS versions - over an RSD tunnel (
RSD_SERVICE_NAME) on iOS 17 and later
The provider is meant to be used as an async context manager, which connects the DTX transport on entry and closes it on exit::
async with DvtProvider(lockdown) as provider:
...
It additionally advertises the process-control terminationCallback
capability so that the device reports process termination events.
Source code in pymobiledevice3/services/dvt/instruments/dvt_provider.py
Process control¶
pymobiledevice3.services.dvt.instruments.process_control.ProcessControl ¶
Bases: DtxService[ProcessControlService]
Launch, terminate and observe processes on the device through the DVT
processcontrol instruments service.
Backed by ProcessControlService, this wraps the remote
process-control DTX channel and exposes high-level operations such as
launching an app, killing it, sending signals and waiving its memory limit.
Iterating over an instance yields OutputReceivedEvent objects for
stdout/stderr output emitted by observed processes.
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
connect
async
¶
Open the instrument's DTX channel and route its message log to this instrument's logger.
signal
async
¶
Send a signal to a running process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process to signal. |
required |
sig
|
int
|
Signal number to send. |
required |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
disable_memory_limit_for_pid
async
¶
Waive the memory limit (jetsam limit) for a given process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process whose memory limit should be lifted. |
required |
Raises:
| Type | Description |
|---|---|
DisableMemoryLimitError
|
If the device declines the request. |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
kill
async
¶
Kill a process by sending it SIGKILL.
Implemented via sendSignal:toPid: (which awaits a reply) rather than the
fire-and-forget killPid:: the round-trip guarantees the device has acted on the
request before the DTX channel — and, on iOS 17+, the tunnel — is torn down. A bare
killPid: is silently dropped when the channel closes immediately after sending it
(observed over the default userspace tunnel), leaving the target process alive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process to kill. |
required |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
is_debuggable
async
¶
Tell whether the device lets developer tools inspect a process.
That is the case for development-signed apps (those with get-task-allow), which the
memory instruments are limited to on a production device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process to check. |
required |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
suspend
async
¶
Suspend a process until resume is called for it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process to suspend. |
required |
resume
async
¶
Resume a process that was suspended with suspend or launched suspended.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
PID of the process to resume. |
required |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
process_identifier_for_bundle_identifier
async
¶
Resolve the PID of a currently running process by its bundle identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_bundle_identifier
|
str
|
Bundle identifier of the running app. |
required |
Returns:
| Type | Description |
|---|---|
int
|
PID of the matching process, or 0 if no such process is running. |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
launch
async
¶
launch(bundle_id: str, arguments: Optional[list[str]] = None, kill_existing: bool = True, start_suspended: bool = False, environment: Optional[dict[str, Any]] = None, extra_options: Optional[dict[str, Any]] = None) -> int
Launch an installed application by its bundle identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bundle_id
|
str
|
Bundle identifier of the app to launch. |
required |
arguments
|
Optional[list[str]]
|
List of command-line arguments to pass to the process.
Defaults to an empty list when |
None
|
kill_existing
|
bool
|
Whether to kill an already-running instance of the app
before launching (sent as the |
True
|
start_suspended
|
bool
|
Start the process suspended, waiting for a debugger to
attach (sent as the |
False
|
environment
|
Optional[dict[str, Any]]
|
Environment variables to set for the process. Defaults to an
empty dict when |
None
|
extra_options
|
Optional[dict[str, Any]]
|
Additional launch options merged into the options dict sent to the device, overriding the defaults on key collision. |
None
|
Returns:
| Type | Description |
|---|---|
int
|
PID of the newly launched process. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If the device returns a falsy PID (launch failure). |
Source code in pymobiledevice3/services/dvt/instruments/process_control.py
Device & application info¶
pymobiledevice3.services.dvt.instruments.device_info.DeviceInfo ¶
Bases: DtxService[DeviceInfoService]
Query device, process, filesystem and kernel information over the
com.apple.instruments.server.services.deviceinfo DTX channel.
Constructed with a DvtProvider, e.g. DeviceInfo(DvtProvider(service_provider)),
and used as an async context manager to open the channel.
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
ls
async
¶
List the contents of a directory on the device.
Invokes the directoryListingForPath: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Absolute path of the directory to list. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
The directory entries. |
Raises:
| Type | Description |
|---|---|
DvtDirListError
|
If the listing fails or the device returns no result. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
execname_for_pid
async
¶
Get the executable path of a running process.
Invokes the execnameForPid: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
Process identifier. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Full executable path of the process. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
proclist
async
¶
Get the list of running processes from the device.
Invokes the runningProcesses selector. Any per-process startDate
field is normalized to a datetime.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
One dict of attributes per running process. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
is_running_pid
async
¶
Check whether a process is currently running.
Invokes the isRunningPid: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pid
|
int
|
Process identifier. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
system_information
async
¶
Get general system information.
Invokes the systemInformation selector.
Returns:
| Type | Description |
|---|---|
|
Mapping of system attributes (OS build, device name, etc.). |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
hardware_information
async
¶
Get hardware information.
Invokes the hardwareInformation selector.
Returns:
| Type | Description |
|---|---|
|
Mapping of hardware attributes (CPU count, model, etc.). |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
network_information
async
¶
Get network interface information.
Invokes the networkInformation selector.
Returns:
| Type | Description |
|---|---|
|
Mapping describing the device's network interfaces. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
mach_time_info
async
¶
Get the Mach absolute-time clock parameters.
Invokes the machTimeInfo selector.
Returns:
| Type | Description |
|---|---|
|
Mapping with the Mach timebase and current time values. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
mach_kernel_name
async
¶
Get the running Mach kernel name.
Invokes the machKernelName selector.
Returns:
| Type | Description |
|---|---|
str
|
The kernel name string. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
kpep_database
async
¶
Get the KPEP (kernel performance event) database.
Invokes the kpepDatabase selector and parses the returned plist bytes.
Returns:
| Type | Description |
|---|---|
Optional[dict[str, Any]]
|
The parsed KPEP database, or |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
trace_codes
async
¶
Get the kernel trace-code table.
Invokes the traceCodesFile selector and parses the whitespace-separated
<hex-code> <name> lines.
Returns:
| Type | Description |
|---|---|
|
Mapping of integer trace code to its symbolic name. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
sysmon_process_attributes
async
¶
Get the per-process attribute names supported by sysmontap.
Invokes the sysmonProcessAttributes selector.
Returns:
| Type | Description |
|---|---|
list[str]
|
The supported process attribute names. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
sysmon_system_attributes
async
¶
Get the system-wide attribute names supported by sysmontap.
Invokes the sysmonSystemAttributes selector.
Returns:
| Type | Description |
|---|---|
list[str]
|
The supported system attribute names. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
name_for_uid
async
¶
Resolve a user id to its user name.
Invokes the nameForUID: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uid
|
int
|
Numeric user id. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The corresponding user name. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
name_for_gid
async
¶
Resolve a group id to its group name.
Invokes the nameForGID: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gid
|
int
|
Numeric group id. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The corresponding group name. |
Source code in pymobiledevice3/services/dvt/instruments/device_info.py
pymobiledevice3.services.dvt.instruments.application_listing.ApplicationListing ¶
Bases: DtxService[ApplicationListingService]
Enumerate the applications installed on the device over the
com.apple.instruments.server.services.device.applictionListing DTX channel.
Constructed with a DvtProvider, e.g. ApplicationListing(DvtProvider(service_provider)),
and used as an async context manager to open the channel.
Source code in pymobiledevice3/services/dvt/instruments/application_listing.py
applist
async
¶
Get the list of installed applications.
Invokes installedApplicationsMatching:registerUpdateToken: with an empty
match filter and no update token, so every installed application is returned.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
One dict of attributes per installed application. |
Source code in pymobiledevice3/services/dvt/instruments/application_listing.py
Capture & telemetry¶
pymobiledevice3.services.dvt.instruments.screenshot.Screenshot ¶
Bases: DtxService[ScreenshotService]
Capture a screenshot of the device's screen over the
com.apple.instruments.server.services.screenshot DTX channel.
Constructed with a DvtProvider, e.g. Screenshot(DvtProvider(service_provider)),
and used as an async context manager to open the channel.
Source code in pymobiledevice3/services/dvt/instruments/screenshot.py
get_screenshot
async
¶
Capture a screenshot of the current screen.
Invokes the takeScreenshot selector.
Returns:
| Type | Description |
|---|---|
bytes
|
The screenshot image as raw bytes. |
Source code in pymobiledevice3/services/dvt/instruments/screenshot.py
pymobiledevice3.services.dvt.instruments.sysmontap.Sysmontap ¶
Bases: Tap
Sample per-process and system-wide telemetry (CPU, memory, etc.) over the
com.apple.instruments.server.services.sysmontap DTX channel.
Constructed with a DvtProvider (passed as dvt) plus the attribute lists
to sample; prefer the create factory, which discovers the supported
attributes automatically. Used as an async context manager, and is async-iterable:
iterating yields the raw sample rows pushed by the device.
Source code in pymobiledevice3/services/dvt/instruments/sysmontap.py
create
async
classmethod
¶
Build a Sysmontap with the device's full set of supported attributes.
Queries DeviceInfo for the supported sysmon process and system attribute
names and uses them to construct the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dvt
|
DtxServiceProvider
|
The |
required |
interval
|
int
|
Sampling interval in milliseconds. |
DEFAULT_INTERVAL_MS
|
Returns:
| Type | Description |
|---|---|
Sysmontap
|
A configured |
Source code in pymobiledevice3/services/dvt/instruments/sysmontap.py
iter_processes
async
¶
Iterate per-process samples, decoded into attribute dicts.
Consumes the raw sample rows, keeps only those carrying a Processes
entry, and maps each process's values onto the requested process
attribute names.
:yields: For each sample, the list of per-process attribute dicts.
Source code in pymobiledevice3/services/dvt/instruments/sysmontap.py
pymobiledevice3.services.dvt.instruments.network_monitor.NetworkMonitor ¶
Bases: DtxService[NetworkMonitorService]
Monitor device network activity over the Instruments networking channel.
Constructed with a DvtProvider. Use as an async context manager: entering starts
monitoring and exiting stops it. The object is async-iterable, yielding decoded
InterfaceDetectionEvent, ConnectionDetectionEvent and ConnectionUpdateEvent
instances as they arrive.
Source code in pymobiledevice3/services/dvt/instruments/network_monitor.py
pymobiledevice3.services.dvt.instruments.energy_monitor.EnergyMonitor ¶
Bases: DtxService[EnergyMonitorService]
Sample per-process energy usage from the Xcode debug-gauge energy provider.
Constructed with a DvtProvider and the list of PIDs to monitor. Use as an async context
manager: entering starts sampling for those PIDs and exiting stops it. The object is
async-iterable, yielding one energy-attribute sample for the monitored PIDs per iteration.
Source code in pymobiledevice3/services/dvt/instruments/energy_monitor.py
pymobiledevice3.services.dvt.instruments.network_statistics.NetworkStatistics ¶
Bases: DtxService[NetworkStatisticsService]
Sample per-process network traffic from the Xcode debug-gauge network provider.
Constructed with a DvtProvider and the list of PIDs to monitor. Use as an async context
manager: entering starts sampling for those PIDs and exiting stops it. The object is
async-iterable, yielding one sample per interval that maps each PID to its counters:
cumulative net.bytes/net.packets totals plus their net.rx.*/net.tx.* split,
a .delta of each, the pid and the sample time.
Source code in pymobiledevice3/services/dvt/instruments/network_statistics.py
pymobiledevice3.services.dvt.instruments.graphics.Graphics ¶
Bases: DtxService[GraphicsService]
Sample GPU/OpenGL graphics performance counters over the Instruments channel.
Constructed with a DvtProvider. Use as an async context manager: entering starts sampling
and exiting stops it. The object is async-iterable, yielding graphics sample events as they
arrive from the device. fps() yields just the frame rate.
Source code in pymobiledevice3/services/dvt/instruments/graphics.py
fps
async
¶
Yield the Core Animation frame rate of the whole display, about once a second.
Call it in place of iterating the object directly. The first sample arrives right after sampling starts and doesn't cover a full second, so it is skipped.
:yields: Frames per second; 0 while nothing on screen changes.
Source code in pymobiledevice3/services/dvt/instruments/graphics.py
pymobiledevice3.services.dvt.instruments.activity_trace_tap.ActivityTraceTap ¶
Bases: Tap
Tap the device's unified-logging / activity-trace stream over the Instruments channel.
Constructed with a DvtProvider. It is an async-iterable Tap: iterating yields decoded
log entries (signposts and os_log messages) as message dataclass instances whose fields
follow the table columns advertised by the device, plus device_time: the row's time on the
device's clock as a datetime, or None if the device has not sent its time mapping (it does so
before the first row). The underlying wire format is a stack-based opcode stream parsed
incrementally; opcodes split across DTX frames are carried over and reassembled.
Source code in pymobiledevice3/services/dvt/instruments/activity_trace_tap.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | |
pymobiledevice3.services.dvt.instruments.core_profile_session_tap.CoreProfileSessionTap ¶
Kdebug is a kernel facility for tracing events occurring on a system. This header defines reserved debugids, which are 32-bit values that describe each event:
+----------------+----------------+----------------------------+----+ | Class (8) | Subclass (8) | Code (14) |Func| | | | |(2) | +----------------+----------------+----------------------------+----+ _________________________________/ ClassSubclass (CSC) _00/ Eventid _____/ Debugid
The eventid is a hierarchical ID, indicating which components an event is referring to. The debugid includes an eventid and two function qualifier bits, to determine the structural significance of an event (whether it starts or ends an interval).
This tap yields kdebug events.
Constructed with a DvtProvider. Use as an async context manager (async with): entering
configures and starts the session, exiting stops it. While active it can produce a one-time
stackshot and stream raw kdebug buffer chunks.
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | |
get_stackshot
async
¶
Wait for and parse the stackshot the device emits once per tap creation.
Non-stackshot messages are discarded while waiting. The result is parsed and cached, so subsequent calls return the cached value immediately. Loaded images in the parsed stackshot are annotated with their shared-cache paths where resolvable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
Optional[float]
|
Seconds to wait for stackshot data; |
10.0
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The parsed stackshot dictionary. |
Raises:
| Type | Description |
|---|---|
ExtractingStackshotError
|
If the timeout elapses, or the device sends a raw kdebug (version 2) buffer instead of a stackshot. |
DvtException
|
If the device reports that kperf is already owned by another session. |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
dump
async
¶
Stream raw kdebug trace data from the session to a file.
Stackshot and bplist messages are skipped; only kernel trace chunks are written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out
|
BinaryIO
|
Binary file object to write the trace data to. |
required |
timeout
|
Optional[float]
|
Seconds to keep dumping; |
None
|
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
pump_kdbuf_chunks
async
¶
Continuously forward received messages into a queue for consumption by a KdBufStream.
Runs until cancelled or the connection ends. On termination or error the offending
exception is placed on the queue; a None sentinel is always enqueued last.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk_queue
|
Queue[Any]
|
Queue that receives each raw chunk, then any exception, then a final
|
required |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
get_kdbuf_stream ¶
get_kdbuf_stream(chunk_queue: Queue[Any], max_lag: Optional[float] = None, on_skip: Optional[Callable[[int, float], None]] = None, on_wait: Optional[Callable[[], None]] = None) -> KdBufStream
Wrap a chunk queue in a file-like KdBufStream for reading the kd_buf trace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk_queue
|
Queue[Any]
|
Queue being fed by |
required |
max_lag
|
Optional[float]
|
Skip events more than this many seconds behind real time (see |
None
|
on_skip
|
Optional[Callable[[int, float], None]]
|
Called with the number of skipped events and the lag in seconds, once per catch-up. |
None
|
on_wait
|
Optional[Callable[[], None]]
|
Called before the stream waits for the next chunk (see |
None
|
Returns:
| Type | Description |
|---|---|
KdBufStream
|
A seekable, readable stream over the queued kd_buf chunks. |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
parse_stackshot
staticmethod
¶
Parse raw KCDATA stackshot bytes into a nested dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
Raw stackshot buffer beginning with the stackshot KCDATA header. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The stackshot contents as a dictionary. |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
get_time_config
async
staticmethod
¶
Build the time_config mapping required to construct a CoreProfileSessionTap.
Combines the device's mach timebase and absolute time with the host-visible wall-clock epoch and timezone offset taken from lockdown values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dvt
|
DtxServiceProvider
|
The |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dict with |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
get_trace_codes
async
staticmethod
¶
Fetch the device's kdebug trace-code table, mapping numeric debugids to symbol names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dvt
|
DtxServiceProvider
|
The |
required |
Returns:
| Type | Description |
|---|---|
dict[int, str]
|
A mapping of debugid code to its trace-code name. |
Source code in pymobiledevice3/services/dvt/instruments/core_profile_session_tap.py
pymobiledevice3.services.dvt.instruments.notifications.Notifications ¶
Bases: DtxService[NotificationsService]
Stream application-state and memory notifications from the device over the
com.apple.instruments.server.services.mobilenotifications DTX channel.
Constructed with a DvtProvider, e.g. Notifications(DvtProvider(service_provider)).
Entering the async context manager opens the channel and enables both
application-state and memory notifications; exiting disables them. The class
is async-iterable: iterating yields each notification payload as the device
pushes it.
Source code in pymobiledevice3/services/dvt/instruments/notifications.py
Conditions & location¶
pymobiledevice3.services.dvt.instruments.condition_inducer.ConditionInducer ¶
Bases: DtxService[ConditionInducerService]
Induce simulated device conditions (such as degraded network or thermal states) via the Instruments ConditionInducer channel.
Constructed with a DvtProvider. A single condition can be active at a time; enabling one
replaces any previously active condition.
Source code in pymobiledevice3/services/dvt/instruments/condition_inducer.py
list
async
¶
List the condition groups available on the device.
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
The available condition inducers, each a group dict containing an |
Source code in pymobiledevice3/services/dvt/instruments/condition_inducer.py
set
async
¶
Activate the condition profile with the given identifier.
Searches every available group for a profile whose identifier matches, then enables it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile_identifier
|
str
|
Identifier of the profile to activate. |
required |
Raises:
| Type | Description |
|---|---|
PyMobileDevice3Exception
|
If no available profile matches |
Source code in pymobiledevice3/services/dvt/instruments/condition_inducer.py
clear
async
¶
Disable the currently active condition, returning the device to normal behavior.
pymobiledevice3.services.dvt.instruments.location_simulation.LocationSimulation ¶
Bases: DtxService[LocationSimulationService], LocationSimulationBase
Override the device's reported GPS location over the
com.apple.instruments.server.services.LocationSimulation DTX channel.
Constructed with a DvtProvider, e.g. LocationSimulation(DvtProvider(service_provider)),
and used as an async context manager to open the channel.
Source code in pymobiledevice3/services/dvt/instruments/location_simulation.py
set
async
¶
Simulate the device being at the given coordinates.
Invokes the simulateLocationWithLatitude:longitude: selector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
latitude
|
float
|
Latitude in decimal degrees. |
required |
longitude
|
float
|
Longitude in decimal degrees. |
required |
Source code in pymobiledevice3/services/dvt/instruments/location_simulation.py
clear
async
¶
Stop simulating the location and restore the device's real GPS.
Invokes the stopLocationSimulation selector.