Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift
20.6 KB
Raw Blame
expr -l objc -O --
NSMutableArray *vpRecs = [NSMutableArray array];
void (^vpAdd)(NSString *, NSString *, NSString *, id, NSString *) = ^(NSString *api, NSString *kind, NSString *call, id value, NSString *error) {
  [vpRecs addObject:@{@"api": api, @"kind": kind, @"call": call, @"value": value ?: [NSNull null], @"error": error ?: [NSNull null]}];
};
NSArray *vpKeys = @[@"720p", @"ADSCapability", @"ASTC", @"AV1DecodingCapability", @"AWDLCapability", @"AccelerometerCapability", @"AggregateDevicePhotoZoomFactor", @"AggregateDeviceVideoZoomFactor", @"AirDropCapability", @"AirplayMirroringCapability", @"AlwaysOnDisplayMaxMemory", @"AppleDisplay", @"AppleNeuralEngineSubtype", @"ArrowChipID", @"ArtworkDeviceIdiom", @"ArtworkDeviceProductDescription", @"ArtworkDeviceScaleFactor", @"ArtworkDeviceSubType", @"ArtworkDisplayGamut", @"ArtworkDynamicDisplayMode", @"ArtworkTraitDisplayGamut", @"ArtworkTraits", @"AudioExclaveMicInputCapability", @"AudioPlaybackCapability", @"AvailableDisplayZoomSizes", @"BacklightCapability", @"BasebandChipID", @"BoardId", @"BuildVersion", @"CPUArchitecture", @"CPUSubType", @"CPUType", @"CameraFrontFlashCapability", @"CameraHDR2Capability", @"CameraLiveEffectsCapability", @"CarrierInstallCapability", @"CellularTelephonyCapability", @"CertificateProductionStatus", @"ChipID", @"CloudPhotoLibraryCapability", @"CoastlineGlowRenderingCapability", @"ContinuityCapability", @"CoreRoutineCapability", @"DeviceBrand", @"DeviceClass", @"DeviceClassNumber", @"DeviceColor", @"DeviceColorMapPolicy", @"DeviceCornerRadius", @"DeviceCoverGlassCoating", @"DeviceCoverGlassColor", @"DeviceCoverGlassMaterial", @"DeviceCoverMaterial", @"DeviceEnclosureColor", @"DeviceEnclosureMaterial", @"DeviceEnclosureRGBColor", @"DeviceHasAggregateCamera", @"DeviceHasEmbeddedSIMOnlyBoard", @"DeviceHasHinge", @"DeviceHasNAN", @"DeviceHousingColor", @"DeviceHousingColorUncooked", @"DeviceIsFoldable", @"DeviceIsMuseCapable", @"DeviceIsNED", @"DeviceIsPortableMac", @"DeviceLaunchTimeLimitScale", @"DeviceMemorySize", @"DeviceName", @"DevicePerformanceMemoryClass", @"DevicePrefers3DBuildingStrokes", @"DevicePrefersBuildingStrokes", @"DevicePrefersCheapTrafficShaders", @"DevicePrefersProceduralAntiAliasing", @"DevicePrefersTrafficAlpha", @"DeviceProximityCapability", @"DeviceRequiresPetalOptimization", @"DeviceRequiresProximityAmeliorations", @"DeviceRequiresSoftwareBrightnessCalculations", @"DeviceSceneUpdateTimeLimitScale", @"DeviceSupports1080p", @"DeviceSupports3DImagery", @"DeviceSupports3DMaps", @"DeviceSupports3rdPartyHaptics", @"DeviceSupports4G", @"DeviceSupports4k", @"DeviceSupports720p", @"DeviceSupports80ChargeLimit", @"DeviceSupports9Pin", @"DeviceSupportsAODVibrancy", @"DeviceSupportsAOP", @"DeviceSupportsAOP2", @"DeviceSupportsASTC", @"DeviceSupportsAbsoluteAltimeter", @"DeviceSupportsAbsoluteDepth", @"DeviceSupportsActionAfterPowerConnect", @"DeviceSupportsActiveNFCReadingOnly", @"DeviceSupportsAdaptiveMapsUI", @"DeviceSupportsAdvancedMapRendering", @"DeviceSupportsAdvancedVoiceProcessorChatFlavor", @"DeviceSupportsAlmond", @"DeviceSupportsAlwaysAPVoiceTrigger", @"DeviceSupportsAlwaysListening", @"DeviceSupportsAlwaysListeningHeySiri", @"DeviceSupportsAlwaysOnCompass", @"DeviceSupportsAlwaysOnDisplay", @"DeviceSupportsAlwaysOnDisplayFlipbook", @"DeviceSupportsAlwaysOnTime", @"DeviceSupportsApplePencil", @"DeviceSupportsAudioIntelligence", @"DeviceSupportsAutoDim", @"DeviceSupportsAutoLowLightVideo", @"DeviceSupportsAvatars", @"DeviceSupportsBatteryInformation", @"DeviceSupportsBatteryModuleAuthentication", @"DeviceSupportsBeacon", @"DeviceSupportsBerkelium2", @"DeviceSupportsBootChime", @"DeviceSupportsBreathingDisturbancesMeasurements", @"DeviceSupportsBrook", @"DeviceSupportsCCK", @"DeviceSupportsCameraCaptureOnTouchDown", @"DeviceSupportsCameraDeferredProcessing", @"DeviceSupportsCameraHaptics", @"DeviceSupportsCarIntegration", @"DeviceSupportsClosedLoopHaptics", @"DeviceSupportsCollisionSOS", @"DeviceSupportsCompassOrienteering", @"DeviceSupportsConcurrentHPLPMics", @"DeviceSupportsContextualVolume", @"DeviceSupportsContinuousHeartRate", @"DeviceSupportsCorrectedTemperature", @"DeviceSupportsCrudeProx", @"DeviceSupportsCyclingAutoStartReminders", @"DeviceSupportsDCP", @"DeviceSupportsDClr", @"DeviceSupportsDarwinInitConfigFromNVRAM", @"DeviceSupportsDisplayPort", @"DeviceSupportsDoNotDisturbWhileDriving", @"DeviceSupportsDualDisplay", @"DeviceSupportsDynamicEndOfCharge", @"DeviceSupportsDynamicEndOfChargeLegacyHW", @"DeviceSupportsDynamicIsland", @"DeviceSupportsELabel", @"DeviceSupportsEUCapabilities", @"DeviceSupportsElton", @"DeviceSupportsEnhancedAC3", @"DeviceSupportsEnhancedMultitasking", @"DeviceSupportsEnvironmentalDosimetry", @"DeviceSupportsExternalHDR", @"DeviceSupportsFairPlaySecureVideoPath", @"DeviceSupportsFindApplePencil", @"DeviceSupportsFloorCounting", @"DeviceSupportsFoldable", @"DeviceSupportsFrameSynchronousBrightness", @"DeviceSupportsGammaContrastPreservation", @"DeviceSupportsGenerativeModelSystems", @"DeviceSupportsGrayDimming", @"DeviceSupportsGrey", @"DeviceSupportsHDRDeferredProcessing", @"DeviceSupportsHDRPhotoDisplay", @"DeviceSupportsHandwritingSynthesisModel", @"DeviceSupportsHaptics", @"DeviceSupportsHardwareDetents", @"DeviceSupportsHeartHealthAlerts", @"DeviceSupportsHeartRateVariability", @"DeviceSupportsHiResBuildings", @"DeviceSupportsHighLuminanceAlwaysOnDisplay", @"DeviceSupportsHypertensivePatternMeasurements", @"DeviceSupportsIndependentOutputOnSpeaker", @"DeviceSupportsInductiveCharging", @"DeviceSupportsInstructionFollowingPruningModels", @"DeviceSupportsLaguna", @"DeviceSupportsLandscapeFaceID", @"DeviceSupportsLanguageDownloadUI", @"DeviceSupportsLineIn", @"DeviceSupportsLiveActivities", @"DeviceSupportsLivePhotoAuto", @"DeviceSupportsLiveVideoRendering", @"DeviceSupportsLongFormAudio", @"DeviceSupportsLowLatency", @"DeviceSupportsLowPowerSoundClassification", @"DeviceSupportsLowPowerWake", @"DeviceSupportsMTP", @"DeviceSupportsMapsBlurredUI", @"DeviceSupportsMapsOpticalHeading", @"DeviceSupportsMomentCapture", @"DeviceSupportsMultiUser", @"DeviceSupportsNFC", @"DeviceSupportsNavigation", @"DeviceSupportsNewton", @"DeviceSupportsOnDemandPhotoAnalysis", @"DeviceSupportsP3ColorspaceVideoRecording", @"DeviceSupportsPeriodicALSUpdates", @"DeviceSupportsPersonalTranslator", @"DeviceSupportsPhotosInpainting", @"DeviceSupportsPhotosLocalLight", @"DeviceSupportsPortraitIntensityAdjustments", @"DeviceSupportsPortraitLightEffectFilters", @"DeviceSupportsPulseWidthMaximization", @"DeviceSupportsRGB10", @"DeviceSupportsRaiseToSpeak", @"DeviceSupportsRegionalCameraShutterRelaxation", @"DeviceSupportsReverseZoom", @"DeviceSupportsSandcat", @"DeviceSupportsSecureDoubleClick", @"DeviceSupportsSecureMicrophone", @"DeviceSupportsSiDP", @"DeviceSupportsSideButtonClickSpeed", @"DeviceSupportsSimplisticRoadMesh", @"DeviceSupportsSingleCameraPortrait", @"DeviceSupportsSingleDisplayEnhancedMultitasking", @"DeviceSupportsSiriBargeIn", @"DeviceSupportsSiriHub", @"DeviceSupportsSiriSpeaks", @"DeviceSupportsSiriSpokenMessages", @"DeviceSupportsSiriUnderstandingOnDevice", @"DeviceSupportsSpatialAudioCapture", @"DeviceSupportsSpatialFaceTimeAudioPlayback", @"DeviceSupportsSpatialOverCapture", @"DeviceSupportsStageLightPortraitPreview", @"DeviceSupportsStereoAudioRecording", @"DeviceSupportsStudioLightPortraitPreview", @"DeviceSupportsSwimmingWorkouts", @"DeviceSupportsTapToWake", @"DeviceSupportsTelephonyOverUSB", @"DeviceSupportsTethering", @"DeviceSupportsThunderbolt", @"DeviceSupportsTimeInDaylight", @"DeviceSupportsToneMapping", @"DeviceSupportsTouchSensitiveCameraControl", @"DeviceSupportsUSBTypeCDisplay", @"DeviceSupportsUSLegallyCompliantBloodOxygen", @"DeviceSupportsUltraLowPowerNetworking", @"DeviceSupportsUnconditionalPluckItCollection", @"DeviceSupportsUntrustedRemoteSysdiagnose", @"DeviceSupportsVSHCompensation", @"DeviceSupportsVirtualResearchEnvironment", @"DeviceSupportsVoiceOverCanUseSiriVoice", @"DeviceSupportsWalkingRadiusAnimation", @"DeviceSupportsWatchSpeakerPlayback", @"DeviceSupportsWebkit", @"DeviceSupportsWirelessChargingEnergyUseNotification", @"DeviceSupportsWirelessSplitting", @"DeviceSupportsYCbCr10", @"DeviceSupportseARC", @"DeviceSurfaceType", @"DeviceVariant", @"DeviceVariantGuess", @"DisplayBootRotation", @"DisplayDriverICChipID", @"DisplayExtendedProperties", @"DisplayInactiveBrightnessClass", @"DisplayMaxNits", @"DisplayPort", @"DualSIMActivationPolicyCapable", @"EUICCChipID", @"EffectiveProductionStatusAp", @"EffectiveProductionStatusSEP", @"ExclaveCapability", @"ExpandedNits", @"ExpandedNitsFailureCount", @"ExternalChargeCapability", @"ExternalDisplayCapability", @"FaceTimeFrontCameraTemporalNoiseReductionMode", @"FirstPartyLaunchTimeLimitScale", @"FloatingLiveAppOverlay", @"ForwardCameraCapability", @"FrontCameraOffsetFromDisplayCenter", @"FrontCameraRotationForISP", @"FrontCameraRotationFromDisplayNormal", @"FrontFacingCameraAutoHDRCapability", @"FrontFacingCameraBurstCapability", @"FrontFacingCameraHDRCapability", @"FrontFacingCameraHDROnCapability", @"FrontFacingCameraHFRCapability", @"FrontFacingCameraHFRVideoCapture1080pMaxFPS", @"FrontFacingCameraHFRVideoCapture720pMaxFPS", @"FrontFacingCameraMaxVideoZoomFactor", @"FrontFacingCameraStageLightPortraitCaptureCapability", @"FrontFacingCameraSuperWideCameraCapability", @"FrontFacingCameraVariableFrameRateCapability", @"FrontFacingCameraVideoCapture1080pMaxFPS", @"FrontFacingCameraVideoCapture720pMaxFPS", @"FrontFacingLowLightCameraCapability", @"GPSCapability", @"GSDeviceName", @"GraphicsFeatureSetClass", @"GraphicsFeatureSetFallbacks", @"GyroscopeCapability", @"H264EncoderCapability", @"HEVCDecoder10bitSupported", @"HEVCDecoder12bitSupported", @"HEVCDecoder8bitSupported", @"HEVCEncodingCapability", @"HWModelDescriptionForAnalytics", @"HWModelDescriptionForAudio", @"HWModelDescriptionForAutomatedTesting", @"HWModelDescriptionForCamera", @"HWModelDescriptionForPowerPerf", @"HWModelDescriptionForUserVisibility", @"HWModelStr", @"HWModelUniqueStr", @"HardwarePlatform", @"HasExtendedColorDisplay", @"HasPartiallyOccludedDisplay", @"HasSpringBoard", @"HasThinBezel", @"HearingAidAudioEqualizationCapability", @"HearingAidLowEnergyAudioCapability", @"HearingAidPowerReductionCapability", @"HingeCapability", @"HomeButtonType", @"HorsemanCapability", @"HumanReadableProductVersionString", @"IDAMCapability", @"IOSDIOProductInfo1", @"IOSurfaceFormatDictionary", @"IsEmulatedDevice", @"IsFoldable", @"IsLargeFormatPhone", @"IsSimulatedDevice", @"IsSimulator", @"IsVirtualDevice", @"LaunchTimeLimitScaleSupported", @"LisaCapability", @"LowPowerRendererCapability", @"MLEHW", @"MainDisplayRotation", @"MainScreenCanvasSizes", @"MainScreenClass", @"MainScreenScale", @"MarketingDeviceFamilyName", @"MarketingProductName", @"MarketingVersion", @"MaximumNitsToSnap", @"MaximumScreenScale", @"MedusaFloatingLiveAppCapability", @"MedusaOverlayAppCapability", @"MedusaPIPCapability", @"MedusaPinnedAppCapability", @"MetalPerfLevelCapability", @"ModelNumber", @"MultiTouchCapability", @"NikeIpodCapability", @"OLEDDisplay", @"OSMigrationCapability", @"OfflineDictationCapability", @"OysterCapability", @"PTPLargeFilesCapability", @"PanoramaCameraCapability", @"PearlCameraCapability", @"PearlIDCapability", @"PearlMotionDetectionCapability", @"PeekUICapability", @"PeekUIWidth", @"PerfLevelCapability", @"PersonalHotspotCapability", @"PhosphorusCapability", @"PhotoCapability", @"PhotosPostEffectsCapability", @"PiPOverlay", @"PiPPinned", @"PipelinedStillImageProcessingCapability", @"PlatinumCapability", @"ProductBuildVersion", @"ProductHash", @"ProductName", @"ProductType", @"ProductTypeDescForAnalytics", @"ProductTypeDescForAudio", @"ProductTypeDescForAutomatedTesting", @"ProductTypeDescForCamera", @"ProductTypeDescForPowerPerf", @"ProductTypeDescForUserVisibility", @"ProductVersion", @"ProductVersionExtra", @"QuickNoteCapability", @"RearALSCapability", @"RearCameraCapability", @"RearCameraOffsetFromDisplayCenter", @"RearFacingCamera60fpsVideoCaptureCapability", @"RearFacingCameraAutoHDRCapability", @"RearFacingCameraBurstCapability", @"RearFacingCameraFocusPixelCalibrationCapability", @"RearFacingCameraHDRCapability", @"RearFacingCameraHDROnCapability", @"RearFacingCameraHFRCapability", @"RearFacingCameraHFRVideoCapture1080pMaxFPS", @"RearFacingCameraHFRVideoCapture720pMaxFPS", @"RearFacingCameraMaxVideoZoomFactor", @"RearFacingCameraStageLightPortraitCaptureCapability", @"RearFacingCameraSuperWideCameraCapability", @"RearFacingCameraTimeOfFlightCameraCapability", @"RearFacingCameraVariableFrameRateCapability", @"RearFacingCameraVideoCapture1080pMaxFPS", @"RearFacingCameraVideoCapture720pMaxFPS", @"RearFacingLowLightCameraCapability", @"RearFacingTelephotoCameraCapability", @"ReceiveARCStreamOverAirPlayCapability", @"RegulatoryModelNumber", @"RenderWideGamutImagesAtDisplayTime", @"ResponsiveAirPlayAudioCapability", @"RingerButtonCapability", @"RoswellChipID", @"SavageChipID", @"ScaleToFit", @"ScreenCaptureHeight", @"ScreenCaptureWidth", @"ScreenDimensions", @"ScreenDimensionsCapability", @"ScreenRecorderCapability", @"SiKACapability", @"SiriGestureCapability", @"SiriOfflineCapability", @"SnapToNits", @"SpatialAudioProfileCapability", @"SphereCapability", @"StarkCapability", @"SubProductType", @"SupplementalBuildVersion", @"SupportedDeviceFamilies", @"SupportsForceTouch", @"TargetSubType", @"ThinningProductType", @"ThreadRadioCapability", @"TimeSyncCapability", @"TopModuleAuthChipID", @"TorpedoCapability", @"UIParallaxCapability", @"UIProceduralWallpaperCapability", @"VSHCompensationMinimumNits", @"VibratorCapability", @"VideoStillsCapability", @"WatchAppButtonCapability", @"WatchKeyboardCapability", @"WiFiCallingCapability", @"WifiCallingSecondaryDeviceCapability", @"WirelessChargingCapability", @"YonkersChipID", @"accelerometer", @"accessibility", @"always-on-device", @"always-on-device-flipbook", @"always-on-time", @"ambient-light-sensor", @"applicationInstallation", @"arm64", @"armv6", @"armv7", @"armv7s", @"bluetooth", @"bluetooth-le", @"cellular-data", @"contains-cellular-radio", @"cover-glass", @"cover-glass-material", @"device-name", @"device-name-localized", @"display-mirroring", @"displayGamut", @"displayport", @"displays", @"dynamicDisplayMode", @"encrypted-data-partition", @"full-6", @"gamekit", @"gas-gauge-battery", @"generative-model-systems", @"graphicsFeatureSetClass", @"graphicsFeatureSetFallbacks", @"gyroscope", @"hall-effect-sensor", @"hardware-keyboard", @"hide-non-default-apps", @"hidpi", @"homescreen-wallpaper", @"iAP2Capability", @"idiom", @"international-settings", @"ipad", @"kMGQDeviceSurfaceType", @"load-thumbnails-while-scrolling", @"location-services", @"magnetometer", @"main-screen-class", @"main-screen-height", @"main-screen-orientation", @"main-screen-pitch", @"main-screen-scale", @"main-screen-width", @"marketing-name", @"marketing-soc-name", @"marketing-software-behavior", @"memoryClass", @"metal", @"microphone", @"model-config", @"modelIdentifier", @"multitasking", @"multitasking-gestures", @"nativeOrientation", @"opengles-1", @"opengles-2", @"pearl-id", @"peer-peer", @"proximity-sensor", @"reverse-zoom", @"ringer-switch", @"scale", @"screen-capture-height", @"screen-capture-width", @"screen-dimensions", @"screenrecorder", @"shoebox", @"sms", @"software-dimming-alpha", @"stand-alone-contacts", @"subtype", @"telephony", @"touch-id", @"unified-ipod", @"unique-model", @"vm-supports-generative-models", @"watch-companion", @"wifi", @"zoomed"];
id (*vpMG)(NSString *) = (id (*)(NSString *))dlsym(RTLD_DEFAULT, "MGCopyAnswer");
for (NSString *vpK in vpKeys) {
  id vpV = vpMG(vpK);
  vpAdd([@"MGCopyAnswer." stringByAppendingString:vpK], @"private", [NSString stringWithFormat:@"MGCopyAnswer(@\"%@\")", vpK], vpV, vpV ? nil : @"nil");
}
long long (*vpCount)(void) = (long long (*)(void))dlsym(RTLD_DEFAULT, "MGGetLogicalDeviceDisplayCount");
long long vpN = vpCount ? vpCount() : -1;
vpAdd(@"MGGetLogicalDeviceDisplayCount", @"private", @"MGGetLogicalDeviceDisplayCount()", vpCount ? @(vpN) : nil, vpCount ? nil : @"symbol missing");
id (*vpMGD)(void *, long long, void *, void *) = (id (*)(void *, long long, void *, void *))dlsym(RTLD_DEFAULT, "MGCopyAnswerForDisplayAtIndex");
for (NSString *vpQ in @[@"kMGDisplayIndexedQueryCameraButtonCGRect", @"kMGDisplayIndexedQueryCameraButtonNormalizedCGRect", @"kMGDisplayIndexedQueryFrontCameraOffsetFromDisplayCenter", @"kMGDisplayIndexedQueryRearCameraOffsetFromDisplayCenter", @"kMGDisplayIndexedQueryUserIntentPhysicalButtonCGRect", @"kMGDisplayIndexedQueryUserIntentPhysicalButtonNormalizedCGRect", @"kMGDisplayIndexedQueryVolumeDownButtonCGRect", @"kMGDisplayIndexedQueryVolumeDownButtonNormalizedCGRect", @"kMGDisplayIndexedQueryVolumeUpButtonCGRect", @"kMGDisplayIndexedQueryVolumeUpButtonNormalizedCGRect"]) {
  void *vpSym = dlsym(RTLD_DEFAULT, vpQ.UTF8String);
  for (long long vi = 0; vi < (vpN > 0 ? vpN : 0) + 1; vi++) {
    id vpV = (vpMGD && vpSym) ? vpMGD(vpSym, vi, NULL, NULL) : nil;
    vpAdd([@"MGCopyAnswerForDisplayAtIndex." stringByAppendingString:vpQ], @"private", [NSString stringWithFormat:@"MGCopyAnswerForDisplayAtIndex(&%@, %lld, NULL, NULL)", vpQ, vi], vpV ? @{@"index": @(vi), @"value": vpV} : nil, !vpSym ? @"symbol missing" : (vpV ? nil : [NSString stringWithFormat:@"nil at index %lld", vi]));
  }
}
for (NSString *vpS in @[@"hw.model", @"hw.machine", @"hw.product", @"hw.target", @"hw.targettype", @"kern.osversion", @"kern.osproductversion", @"kern.osrelease", @"kern.ostype", @"kern.version", @"hw.cputype", @"hw.cpusubtype", @"hw.memsize", @"hw.ncpu", @"hw.physicalcpu", @"hw.optional.arm64", @"kern.hv_vmm_present", @"kern.bootargs"]) {
  char vpBuf[1024]; size_t vpLen = sizeof(vpBuf); memset(vpBuf, 0, sizeof(vpBuf));
  int vpRc = sysctlbyname(vpS.UTF8String, vpBuf, &vpLen, NULL, 0);
  id vpV = nil;
  if (vpRc == 0) {
    if (vpLen == 4) vpV = @(*(int *)vpBuf);
    else if (vpLen == 8 && ![vpS hasPrefix:@"hw.model"] && ![vpS hasPrefix:@"hw.machine"] && ![vpS hasPrefix:@"hw.product"] && ![vpS hasPrefix:@"hw.target"]) vpV = @(*(long long *)vpBuf);
    else vpV = [NSString stringWithUTF8String:vpBuf];
  }
  vpAdd([@"sysctl." stringByAppendingString:vpS], @"public", [NSString stringWithFormat:@"sysctlbyname(\"%@\")", vpS], vpV, vpRc == 0 ? nil : [NSString stringWithFormat:@"rc=%d errno=%d", vpRc, errno]);
}
struct utsname vpU; uname(&vpU);
vpAdd(@"uname", @"public", @"uname()", @{@"sysname": [NSString stringWithUTF8String:vpU.sysname], @"release": [NSString stringWithUTF8String:vpU.release], @"version": [NSString stringWithUTF8String:vpU.version], @"machine": [NSString stringWithUTF8String:vpU.machine]}, nil);
NSDictionary *vpEnv = [[NSProcessInfo processInfo] environment];
NSMutableDictionary *vpSimEnv = [NSMutableDictionary dictionary];
for (NSString *vpK in vpEnv) if ([vpK hasPrefix:@"SIMULATOR_"] || [vpK hasPrefix:@"DYLD_"] || [vpK hasPrefix:@"CFFIXED"] || [vpK isEqualToString:@"IPHONE_SIMULATOR_ROOT"] || [vpK hasPrefix:@"XPC_SIMULATOR"]) vpSimEnv[vpK] = vpEnv[vpK];
vpAdd(@"NSProcessInfo.environment[SIMULATOR_*]", @"public", @"[[NSProcessInfo processInfo] environment] filtered to SIMULATOR_*, DYLD_*, CFFIXED*, IPHONE_SIMULATOR_ROOT", vpSimEnv, nil);
vpAdd(@"NSProcessInfo.operatingSystemVersionString", @"public", @"[[NSProcessInfo processInfo] operatingSystemVersionString]", [[NSProcessInfo processInfo] operatingSystemVersionString], nil);
vpAdd(@"NSProcessInfo.isiOSAppOnMac", @"public", @"[[NSProcessInfo processInfo] isiOSAppOnMac]", @([[NSProcessInfo processInfo] isiOSAppOnMac]), nil);
vpAdd(@"NSProcessInfo.isMacCatalystApp", @"public", @"[[NSProcessInfo processInfo] isMacCatalystApp]", @([[NSProcessInfo processInfo] isMacCatalystApp]), nil);
__block id (^vpSan)(id) = nil;
vpSan = ^id(id o) {
  if (!o) return [NSNull null];
  if ([(NSObject *)o isKindOfClass:[NSString class]] || [(NSObject *)o isKindOfClass:[NSNull class]]) return o;
  if ([(NSObject *)o isKindOfClass:[NSNumber class]]) { double vpF = [(NSNumber *)o doubleValue]; if (vpF != vpF || vpF > 1.0e308 || vpF < -1.0e308) return [NSString stringWithFormat:@"%f", vpF]; return o; }
  if ([(NSObject *)o isKindOfClass:[NSArray class]]) { NSMutableArray *vpA = [NSMutableArray array]; for (id vpY in (NSArray *)o) [vpA addObject:vpSan(vpY)]; return vpA; }
  if ([(NSObject *)o isKindOfClass:[NSDictionary class]]) { NSMutableDictionary *vpM = [NSMutableDictionary dictionary]; for (id vpK in (NSDictionary *)o) vpM[[(NSObject *)vpK description]] = vpSan(((NSDictionary *)o)[vpK]); return vpM; }
  if ([(NSObject *)o isKindOfClass:[NSData class]]) return @{@"data_base64": [(NSData *)o base64EncodedStringWithOptions:0]};
  if ([(NSObject *)o isKindOfClass:[NSDate class]]) return @{@"date": [(NSObject *)o description]};
  return [(NSObject *)o description] ?: @"";
};
NSDictionary *vpOut = @{@"group": @"identity", @"records": vpRecs};
NSError *vpErr = nil;
NSData *vpData = [NSJSONSerialization dataWithJSONObject:vpSan(vpOut) options:0 error:&vpErr];
vpData ? [[NSString alloc] initWithData:vpData encoding:NSUTF8StringEncoding] : [vpErr description]