appium: Android Logcat is not getting captured and the "getLogTypes" request is failing
The problem
Whenever I run an emulated Android device using Appium, the logcat file used to be created in my ./log
directory. Just recently, those files are not being created per session, and I am not able to see log types either using the method that issues the request for device log types.
Environment
- Appium version (or git revision) that exhibits the issue: 1.20.2 (using package “@wdio/appium-service@^6.12.1”)
- Last Appium version that did not exhibit the issue (if applicable): 1.18.x
- Desktop OS/version used to run Appium: macOS Big Sur 11.6.1
- Node.js version (unless using Appium.app|exe): 12.20.1
- Npm or Yarn package manager: Yarn 1.22.10
- Mobile platform/version under test: Android OS 11.0 (API 30)
- Real device or emulator/simulator: Emulator
- Appium CLI or Appium.app|exe: Appium CLI Edit: not sure if important, but I also have Android tools installed with Android Studio Arctic Fox 2020.3.1 Patch 3.
Also, I am using WebDriverIO version 6.12.1 to launch Appium, but it also fails with WebDriverIO v7.
Details
Android logcat files are not being created at the start of the session. My device capabilities are below:
{
'appium:locale': 'US',
'appium:language': 'en',
'appium:deviceName': "pixel_3a",
'appium:avd': "Pixel_3a_API_30",
'appium:platformVersion': "11.0", //API 30
'appium:app': 'path/to/my-app.apk',
'appium:printPageSourceOnFindFailure': true,
excludeDriverLogs: ['bugreport', 'performance'],
platformName: 'Android',
maxInstances: 1,
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
'appium:noReset': false,
'appium:fullReset': true,
'appium:allowTestPackages': true,
'appium:newCommandTimeout': 240,
'goog:chromeOptions': {
'args': ['--disable-fre', '--no-first-run', '--no-default-browser-check']
}
};
As well, the endpoints for retrieving both device log types and device logs fail:
GET /session/:session_id/log/types
POST /session/:session_id/log
Link to Appium logs
2021-11-16T15:31:29.839Z INFO webdriver: COMMAND getLogTypes()
2021-11-16T15:31:29.839Z INFO webdriver: [GET] http://localhost:4723/wd/hub/session/b2d7848b-dba4-44fa-a603-809f7c11dc79/se/log/types
2021-11-16T15:31:29.846Z WARN webdriver: Request failed with status 404 due to The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Code To Reproduce Issue [ Good To Have ]
I am using WebDriverIO with a Cucumber framework configuration.
Firstly, launch WebDriverIO with an Android device, and then running this code will cause the failure:
const logTypes = await driver.getLogTypes();
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (3 by maintainers)
You could switch to Appium 2. There drivers are decoupled from the server code, so it is possible to install whenever driver version is needed without touching server modules.
ah, i see. probably we need to add the se route in https://github.com/appium/appium-uiautomator2-driver/blob/master/lib/driver.js#L70 as well for some drivers.
This is client side one. I don’t know if webdriverio can it.
i’ve added the selenium v4 route in https://github.com/appium/appium-base-driver/pull/517 It should be in appium 1.22.0