Enable profiling builds identification for iOS (#49137)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49137

# Changelog: [Internal]

Similarly as D66501768, adding new `profiling` query parameter to inspector url for registering profiling fields.

Reviewed By: huntie

Differential Revision: D69057572

fbshipit-source-id: d11d88c7e5260d4ca405564d180d8a0edcb39596
This commit is contained in:
Ruslan Lesiutin
2025-02-04 09:26:11 -08:00
committed by Facebook GitHub Bot
parent 90f6e1010d
commit fbfb251177
@@ -100,6 +100,9 @@ static NSString *getInspectorDeviceId()
static NSURL *getInspectorDeviceUrl(NSURL *bundleURL)
{
auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance();
BOOL isProfilingBuild = inspectorFlags.getIsProfilingBuild();
NSString *escapedDeviceName = [[[UIDevice currentDevice] name]
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier]
@@ -108,11 +111,13 @@ static NSURL *getInspectorDeviceUrl(NSURL *bundleURL)
NSString *escapedInspectorDeviceId = [getInspectorDeviceId()
stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLQueryAllowedCharacterSet];
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@&device=%@",
getServerHost(bundleURL),
escapedDeviceName,
escapedAppName,
escapedInspectorDeviceId]];
return [NSURL
URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@&device=%@&profiling=%@",
getServerHost(bundleURL),
escapedDeviceName,
escapedAppName,
escapedInspectorDeviceId,
isProfilingBuild ? @"true" : @"false"]];
}
@implementation RCTInspectorDevServerHelper