Skip to content

Commit

Permalink
Add app name to inspector device url
Browse files Browse the repository at this point in the history
Reviewed By: bnham, Hypuk

Differential Revision: D5443705

fbshipit-source-id: 8c924948dd512be077e2f566da0cfc4110d5f843
  • Loading branch information
pakoito authored and facebook-github-bot committed Jul 19, 2017
1 parent 90fad3c commit 0d16c7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions React/DevSupport/RCTInspectorDevServerHelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@

static NSURL *getInspectorDeviceUrl(NSURL *bundleURL)
{
NSString *escapedText = [[[UIDevice currentDevice] name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@",
NSString *escapedDeviceName = [[[UIDevice currentDevice] name] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString *escapedAppName = [[[NSBundle mainBundle] bundleIdentifier] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/inspector/device?name=%@&app=%@",
getDebugServerHost(bundleURL),
escapedText]];
escapedDeviceName,
escapedAppName]];
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class DevServerHelper {
private static final String WEBSOCKET_PROXY_URL_FORMAT = "ws://%s/debugger-proxy?role=client";
private static final String PACKAGER_STATUS_URL_FORMAT = "http://%s/status";
private static final String HEAP_CAPTURE_UPLOAD_URL_FORMAT = "http://%s/jscheapcaptureupload";
private static final String INSPECTOR_DEVICE_URL_FORMAT = "http://%s/inspector/device?name=%s";
private static final String INSPECTOR_DEVICE_URL_FORMAT = "http://%s/inspector/device?name=%s&app=%s";
private static final String SYMBOLICATE_URL_FORMAT = "http://%s/symbolicate";
private static final String OPEN_STACK_FRAME_URL_FORMAT = "http://%s/open-stack-frame";

Expand Down Expand Up @@ -317,7 +317,8 @@ public String getInspectorDeviceUrl() {
Locale.US,
INSPECTOR_DEVICE_URL_FORMAT,
mSettings.getPackagerConnectionSettings().getInspectorServerHost(),
AndroidInfoHelpers.getFriendlyDeviceName());
AndroidInfoHelpers.getFriendlyDeviceName(),
mPackageName);
}

public BundleDownloader getBundleDownloader() {
Expand Down

0 comments on commit 0d16c7c

Please sign in to comment.