Restart app doesn't respect processArguments
See original GitHub issueThe problem
We passed processArguments to iOS app and we implemented mock feature there. Process arguments are passed as follows.
config.capabilities = [
{
deviceName: 'iPhone 13',
platformVersion: '15.4',
automationName: 'XCUITest',
...
processArguments: { 'args': ['--mock-fes-api', '--mock-attester-api'] },
},
Passing process arguments work well.
But when I try to restart app with below code restarted session doesn’t respect processArguments
and treat like normal app.
I also tried with closeApp
and activeApp
functions though.
await driver.terminateApp(CommonData.bundleId.id);
await driver.activateApp(CommonData.bundleId.id);
Environment
- Appium version (or git revision) that exhibits the issue: 1.22.3
- Last Appium version that did not exhibit the issue (if applicable): 1.22.3
- Desktop OS/version used to run Appium: Monterey 12.3.1
- Node.js version (unless using Appium.app|exe): 14.17.6
- Npm or Yarn package manager: 6.14.15
- Mobile platform/version under test: iOS 15.4
- Real device or emulator/simulator: Simulator
- Appium CLI or Appium.app|exe: CLI
Link to Appium logs
https://gist.github.com/ioanmo226/14ba87c198383fa66ca2d833db3d417a
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Webdriverio iOS restart app with processArguments
We need to pass arguments in drvier.execute function. Here's the solution. const restartApp = async () => { await driver.
Read more >Win32 app installation failure (can't use Stop-Process) : r/Intune
Hi all, I have a simple .exe app to install for which I'm using Microsoft ... 32 bit Powershell on 64 bit OS,...
Read more >appium-xcuitest-driver - npm
Process arguments and environment which will be sent to the WebDriverAgent server in a new session request. Please use mobile:launchApp to launch an...
Read more >Replacing a Process referenced in an App
Once the process is replaced, the action cannot be undone. Replacing a process where an argument is removed, may lead to invalid bindings...
Read more >Appium 1.5.2 released
Confirm the change and restart the appium. It fixes the App installation and crash for simulators. Ryan May 4, 2016, 9:19pm #8. It...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
activateApp is not designed to set arguments except for bundleId/appPackage (in android).
https://github.com/appium/appium-xcuitest-driver#mobile-launchapp is to give environment arguments in the middle of a session in starting an app process for iOS.
The main purpose of activateApp call is to bring an app from the background to the foreground. It does not really care about arguments.
Use a combination of terminateApp/launchApp (with appropriate options) as @KazuCocoa mentioned above to achieve your goal.