我正在尝试通过排毒打开深层链接。 我的代码:
it('Open Trade Ideas form deep link', async () => {
const url =
'my-url';
// await device.terminateApp();
await device.launchApp({
newInstance: true,
url,
sourceApp: 'my.package.id',
});
});
链接在不使用 detox 时工作正常,但使用 detox,我收到以下错误:
detox[16769] ERROR: [exec.js/SPAWN_STDERR, #21] /system/bin/sh: -e: inaccessible or not found
detox[16769] ERROR: [exec.js/SPAWN_STDERR, #21]
Error: Argument expected after "my-deep-link"
detox[16769] ERROR: [exec.js/EXEC_FAIL, #22] ""/Users/harshlukka/Library/Android/sdk/platform-tools/adb" -s emulator-11438 shell "ps | grep \"com\.package\.id$\""" failed with code = 1, stdout and stderr:
detox[16769] ERROR: [exec.js/EXEC_FAIL, #22]
detox[16769] ERROR: [exec.js/EXEC_FAIL, #22]
detox[16769] ERROR: [exec.js/EXEC_FAIL, #24] ""/Users/harshlukka/Library/Android/sdk/platform-tools/adb" -s emulator-11438 shell "ps | grep \"com\.package\.id$\""" failed with code = 1, stdout and stderr:
detox[16769] ERROR: [exec.js/EXEC_FAIL, #24]
detox[16769] ERROR: [exec.js/EXEC_FAIL, #24]
detox[16769] ERROR: [exec.js/EXEC_FAIL, #25] ""/Users/harshlukka/Library/Android/sdk/platform-tools/adb" -s emulator-11438 shell "ps | grep \"com\.package\.id$\""" failed with code = 1, stdout and stderr:
detox[16769] ERROR: [exec.js/EXEC_FAIL, #25]
detox[16769] ERROR: [exec.js/EXEC_FAIL, #25]
RUNS e2e/dashboard/ideasFlow.e2e.js
^C
harshlukka@Harshs-MacBook-Pro screener-mobile % detox[16768] ERROR: [cli.js] Error: Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 ./e2e/dashboard/ideasFlow.e2e.js
在我的链接中有一个 & 符号 &,我们经常在内部链接中使用它来传递参数,我认为这是一个问题,因为当我删除 & > 符号并且不传递任何参数,我没有收到上述错误。
有以上解决方法的请回复!?