Re-enable asar and unpack PortForwardingMacApp
Summary: Enabled asar packaging for Flipper resources, and set PortForwardingMacApp as unpacked from it, because it is launched as external app. Reviewed By: passy Differential Revision: D26006771 fbshipit-source-id: 91c8401a469a390144bf9867996a66d754ea90e6
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ab31ad69e9
commit
8ce69975a5
@@ -18,9 +18,9 @@ import child_process from 'child_process';
|
||||
const execFile = child_process.execFile;
|
||||
import iosUtil from '../utils/iOSContainerUtility';
|
||||
import IOSDevice from '../devices/IOSDevice';
|
||||
import isProduction from '../utils/isProduction';
|
||||
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice';
|
||||
import {addErrorNotification} from '../reducers/notifications';
|
||||
import {getStaticPath} from '../utils/pathUtils';
|
||||
|
||||
type iOSSimulatorDevice = {
|
||||
state: 'Booted' | 'Shutdown' | 'Shutting Down';
|
||||
@@ -53,18 +53,27 @@ function isAvailable(simulator: iOSSimulatorDevice): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
const portforwardingClient = isProduction()
|
||||
? path.resolve(
|
||||
__dirname,
|
||||
'PortForwardingMacApp.app/Contents/MacOS/PortForwardingMacApp',
|
||||
)
|
||||
: 'PortForwardingMacApp.app/Contents/MacOS/PortForwardingMacApp';
|
||||
const portforwardingClient = path.join(
|
||||
getStaticPath(),
|
||||
'PortForwardingMacApp.app/Contents/MacOS/PortForwardingMacApp',
|
||||
);
|
||||
|
||||
function forwardPort(port: number, multiplexChannelPort: number) {
|
||||
return execFile(portforwardingClient, [
|
||||
`-portForward=${port}`,
|
||||
`-multiplexChannelPort=${multiplexChannelPort}`,
|
||||
]);
|
||||
const childProcess = execFile(
|
||||
portforwardingClient,
|
||||
[`-portForward=${port}`, `-multiplexChannelPort=${multiplexChannelPort}`],
|
||||
(err, stdout, stderr) => {
|
||||
console.error('Port forwarding app failed to start', err, stdout, stderr);
|
||||
},
|
||||
);
|
||||
console.log('Port forwarding app started', childProcess);
|
||||
childProcess.addListener('error', (err) =>
|
||||
console.error('Port forwarding app error', err),
|
||||
);
|
||||
childProcess.addListener('exit', (code) =>
|
||||
console.log(`Port forwarding app exited with code ${code}`),
|
||||
);
|
||||
return childProcess;
|
||||
}
|
||||
|
||||
function startDevicePortForwarders(): void {
|
||||
|
||||
Reference in New Issue
Block a user