Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Commit

Permalink
use bundle id when restarting ios app instead of app name
Browse files Browse the repository at this point in the history
Summary: App names can collide, bundle id is more unique

Reviewed By: lblasa

Differential Revision: D56964151

fbshipit-source-id: 5b18662c702d8fbf1c85ce8167c796af61126a80
  • Loading branch information
antonk52 authored and facebook-github-bot committed May 8, 2024
1 parent f58a91f commit fabbe8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions desktop/flipper-server/src/FlipperServerImpl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ export class FlipperServerImpl implements FlipperServer {
assertNotNull(this.ios);
return this.ios.launchSimulator(udid);
},
'ios-launch-app': async (udid, appName) => {
'ios-launch-app': async (udid, bundleId) => {
assertNotNull(this.ios);
return this.ios.launchApp(udid, appName);
return this.ios.launchApp(udid, bundleId);
},
'ios-idb-kill': async () => {
assertNotNull(this.ios);
Expand Down
6 changes: 3 additions & 3 deletions desktop/flipper-server/src/devices/ios/IOSBridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export class IDBBridge implements IOSBridge {
await this._execIdb(`install ${ipaPath} --udid ${serial}`);
}

async openApp(serial: string, name: string): Promise<void> {
console.log(`Opening app via IDB ${name} ${serial}`);
await this._execIdb(`launch ${name} --udid ${serial} -f`);
async openApp(serial: string, bundleId: string): Promise<void> {
console.log(`Opening app via IDB ${bundleId} ${serial}`);
await this._execIdb(`launch --udid ${serial} ${bundleId} -f`);
}

async getActiveDevices(bootedOnly: boolean): Promise<DeviceTarget[]> {
Expand Down
9 changes: 2 additions & 7 deletions desktop/flipper-server/src/devices/ios/iOSDeviceManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,10 @@ export class IOSDeviceManager {
}
}

async launchApp(udid: string, appName: string) {
async launchApp(udid: string, bundleId: string) {
try {
const bridge = await this.getBridge();
const installedApps = await bridge.getInstalledApps(udid);
const app = installedApps.find((x) => x.name === appName);
if (!app) {
throw new Error(`Could not find requested app "${appName}"`);
}
await bridge.openApp(udid, app.bundleID);
await bridge.openApp(udid, bundleId);
} catch (e) {
console.warn('Failed to launch simulator:', e);
}
Expand Down

0 comments on commit fabbe8b

Please sign in to comment.