Skip to content

Commit f80e4fd

Browse files
committed
Show Android device names & ids for ADB & Frida
1 parent 182f4f5 commit f80e4fd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/intercept/config/android-adb-config.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,15 @@ class AndroidAdbConfig extends React.Component<{
128128
targets={this.deviceIds.map(id => {
129129
const activating = this.inProgressIds.includes(id);
130130

131+
// Only new servers (1.17.0+) expose metadata.devices with names
132+
const deviceName = this.props.interceptor.metadata?.devices?.[id].name
133+
?? id;
134+
131135
return {
132136
id,
133-
title: `Intercept Android device ${id}`,
137+
title: `Intercept Android device ${deviceName}${
138+
id !== deviceName ? ` (ID: ${id})` : ''
139+
}`,
134140
status: activating
135141
? 'activating'
136142
: 'available',
@@ -139,7 +145,7 @@ class AndroidAdbConfig extends React.Component<{
139145
: id.match(/\d+\.\d+\.\d+\.\d+:\d+/)
140146
? <Icon icon={['fas', 'network-wired']} />
141147
: <Icon icon={['fas', 'mobile-alt']} />,
142-
content: id
148+
content: deviceName
143149
};
144150
})}
145151
interceptTarget={this.interceptDevice}

src/components/intercept/config/frida-config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ class FridaConfig extends React.Component<{
402402

403403
return {
404404
id,
405-
title: `${this.deviceClassName} device ${name} in state ${state}`,
405+
title: `${this.deviceClassName} device ${name} (${id}) in state ${state}`,
406406
icon: id.includes("emulator-")
407407
? <Icon icon={['far', 'window-maximize']} />
408408
: id.match(/\d+\.\d+\.\d+\.\d+:\d+/)

0 commit comments

Comments
 (0)