Android CTS - No available device matching the config's requirements - android-source

I am trying to do android compatibility test on SC20 EVb by using cts-tradefed and while trying run cts test by using cts run --plan CTS, it shows this log:
No available device matching the config's requirements for cmd id 1.
What to do?

while in tardefed check whether connected device is detected or not with below command:
cts-tf > list devices
Serial State Allocation Product Variant Build Battery
1770c061 ONLINE Available msm8998 msm8998 QKQ1.191014.001 67
1d9d493d ONLINE Available msm8998 msm8998 QKQ1.191014.001 67
Above command should display all connected android devices and allocation status.
If your device is not listed within the output check with the adb installation within the host.
If CTS is triggered on the device Allocation status will be changed from Available to Allocated.

Please make sure first that you have an adb connection with the device. It the device is connected over adb and you are still facing this issue, please wait for a while, sometimes it might take 5-10 mins to start.Hope its helpful.

Related

is there any way to debug movesense device without movesense programmer?

I'm developing a product using a Movesense sensor. But I don't have a Movesense programmer. Currently, I'm using the DFU method to update the latest firmware. The issue I'm facing is I can't see the logs of the Movesense device. And that is why I don't know which part of my program isn't working correctly or where I made a mistake. So is there any way that I can see the logs?
Thank you in advance.
I had the same question. What I am doing now is:
Use the adbbridge app found here https://www.movesense.com/docs/esw/tools/
You can then add some debug info logs to your code for example: DebugLogger::info("readTemperatureFromSensor() idx: %u", idx);
Then
Open the movesense adb bridge app and connect to the sensor
Use as instructed on the link above the commend to connect to the logs of the Android device and get the info: adb logcat | grep OUTPUT
Make the sensor do what you have programmed it for. If its whiteboard subscribe etc or some ble action.
Then subscribe also to the debug logs for example python_client % adb shell am broadcast -a "android.intent.action.MOVESENSE" --es type subscribe --es path System/Debug/Verbose --es value '''{}''' --es id 2
2 and 3 are interchangeable of course.
PS. Make sure your app is build with the debug module as well
ie:
OPTIONAL_CORE_MODULE(DebugService, true)

error during e2e tests: USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection [duplicate]

We recently upgraded our Windows 10 test environment with ChromeDriver v87.0.4280.20 and Chrome v87.0.4280.66 (Official Build) (64-bit) and after the up-gradation even the minimal program is producing this ERROR log:
[9848:10684:1201/013233.169:ERROR:device_event_log_impl.cc(211)] [01:32:33.170] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
Minimum Code Block:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
driver = webdriver.Chrome(options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
driver.get('https://www.google.com/')
Console Output:
DevTools listening on ws://127.0.0.1:64170/devtools/browser/2fb4bb93-79ab-4131-9e4a-3b65c08dbffb
[9848:10684:1201/013233.169:ERROR:device_event_log_impl.cc(211)] [01:32:33.170] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[9848:10684:1201/013233.172:ERROR:device_event_log_impl.cc(211)] [01:32:33.173] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
Anyone facing the same? Was there any change in ChromeDriver/Chrome v87 with respect to ChromeDriver/Chrome v86?
Any clues will be helpful.
However these log messages can be supressed from appearing on the console through an easy hack i.e. by adding an argument through add_experimental_option() as follows:
options.add_experimental_option('excludeSwitches', ['enable-logging'])
Code Block:
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
# to supress the error messages/logs
options.add_experimental_option('excludeSwitches', ['enable-logging'])
driver = webdriver.Chrome(options=options, executable_path=r'C:\WebDrivers\chromedriver.exe')
driver.get('https://www.google.com/')
My apologies for the log spam. If you aren't having issues connecting to a device with WebUSB you can ignore these warnings. They are triggered by Chrome attempting to read properties of USB devices that are currently suspended.
After going through quite a few discussions, documentations and Chromium issues here are the details related to the surfacing of the log message:
[9848:10684:1201/013233.169:ERROR:device_event_log_impl.cc(211)] [01:32:33.170] USB: usb_device_handle_win.cc:1020 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
Details
It all started with the reporting of chromium issue Remove WebUSB's dependency on libusb on Windows as:
For Linux (probably Mac as well), both WebUSB notification and communication works correctly (after allowing user access to the device in udev rules).
For Windows, it seems that libusb only works with a non-standard WinUsb driver (https://github.com/libusb/libusb/issues/255).
When the hardware is inserted and the VID/PID is unknown to the system, windows 10 correctly loads it's CDC driver for the CDC part and the WinUSB driver (version 10) for the WebUSB part (no red flags). However, it seems that chrome never finds the device until I manually force an older WinUSB driver (version 6 - probably modified also) on the interface.
The solution was implemented in a step-wise manner as follows:
Start supporting some transfers in the new Windows USB backend
Fix bulk/interrupt transfers in the new Windows USB backend
[usb] Read BOS descriptors from the hub driver on Windows
[usb] Collect all composite devices paths during enumeration on Windows
[usb] Remove out parameters in UsbServiceWin helper functions
[usb] Support composite devices in the new Windows backend
[usb] Detect USB functions as Windows enumerates them
[usb] Support composite devices with multiple functions
[usb] Hold interface requests until Windows enumerates functions
[usb] Add direction parameter to ClearHalt
[usb] Count references to a WINUSB_INTERFACE_HANDLE
[usb] Implement blocking operations in the Windows backend
These changes ensured that the new backend was ready to be tested and was available through Chrome Canary and chrome-dev-channel which you can access manually through:
chrome://flags#enable-new-usb-backend
More change requests were submitted as follows:
[usb] Mark calls to SetupDiGetDeviceProperty as potentially blocking: According to hang reports this function performs an RPC call which may take some time to complete. Mark calls with a base::ScopedBlockingCall so that the thread pool knows this task may be busy for a while.
variations: Enable NewUsbBackend in field trial testing config: This flag was experimental as beta-channel uses this change configuration as the default for testing.
As the experimental launch of the new backend appeared to be stable, finally these configuration was enabled by default so that the chanege rolls out to all users of Chrome 87 through usb: Enable new Windows USB backend by default. Revision / Commit
The idea was once this configuration becomes the default for a few milestones, Chromium Team will start removing the Windows-specific code from the old back-end and remove the flag.
Road Ahead
Chromium Team have already merged the revision/commit to Extend new-usb-backend flag expiration within Chrome v90 which will be available soon.
Update
As per #ReillyGrant's [Committer, WebDriver for Google Chrome] comment :
..." it would be good to reduce the log level for these messages so they don't appear on the console by default but we haven't landed code to do that yet"...
References
You can find a couple of relevant detailed discussions in:
Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Selenium on Windows OS
Failed to read descriptor from node connection: A device attached to the system is not functioning error using ChromeDriver Chrome through Selenium
I encounered this problem yesterday,and I has fixed it by update all available windows update.
https://support.microsoft.com/en-us/windows/what-to-try-if-your-touchscreen-doesn-t-work-f159b366-b3ef-99ad-24a4-31a4c62ab46d
A partial solution that worked for me
I was getting this error too. It was stopping my program running.
I unplugged all my USB devices, ran the program, with no error.
Plugged the devices back in, ran the program. I am still getting the error, however, the program finished without the error stopping the program.
Note: For WebdriverIO on Windows 10, this suppresses the error messages for me:
"goog:chromeOptions": { "excludeSwitches": ["enable-logging"] }

Is there a library for MSR605X that works with Raspberry Pi?

I have been trying to locate a working library for the MSR605X magnetic card reader/writer. At time of writing, I have tried five separate libraries. Only two of these were explicitly for the 605X the other three were for the older 605. All the libraries I have tried either did nothing at all or errored before completing a command (can't figure out the errors either).
I am running Raspberry Pi OS 32 bit on a Raspberry Pi 3 B+ the MSR605X communicates via a USB connection.
So far the library that seems to be most complete is: https://pypi.org/project/msrx/
However, I can not get this library to read or write (either nothing happens or I get a Serial exception "cannot reconfig port).
Any help or links to documentation for this reader is welcome.
EDIT: Adding the commands ran with the above library
msrx -D /dev/input/event4 read
msrx -D /dev/input/jso0 read
The -D is to specify the device path (default is /dev/ttyUSB0 which doesn't exist on my system). I obtained the above two paths by searching for USB serial devices then matching the search result to the device ID which I obtained from lsusb.
Running these commands results in a serial exception (could not reconfig port) which I assume means that I have the wrong device path. I have also checked for any tty* device paths that are changed when I plug in the reader. I consistently get a permission denied error whenever trying to run the above commands with a tty* device path (I am root on this system).
msrx author here — MSR605 requires an external 9V power injected into its cable (via the barrel jack port), otherwise it won't power up properly.

Error "System UI isn't responding" while running AOSP build on emulator

I am trying to run AOSP(oreo 8.1) build on emulator.
I used following commands to build AOSP.
source build/envsetup.sh
lunch aosp_arm-eng
make -j4
my build was successful. Now i'm trying to run on emulator using following command.
emulator
emulator is started with following warning message.
Could not automatically detect an ADB binary. Some emulator functionality will not work until a custom path to ADB is added in the extended settings page.
After successful boot "System UI isn't responding" message is displaying on the emulator, also emulator is running real slow.
Any help in resolving this issue is greatly appreciated.
emulator screenshot: system ui isn't responding
emulator: WARNING: system partition size adjusted to match image file (2050 MB > 200 MB)
emulator: WARNING: encryption is off
main-loop: WARNING: I/O thread spun for 1000 iterations
It often occurs - especially on slow machines running CPU-consuming emulations, that an emulator would initially load into a state where a System UI isn't responding alert shows. It does not necessarily mean the device isn't working; Often enough, the alert can be dismissed and the device will be completely functional from that point on.
I'm not sure what the exact issue to solve here is. Nevertheless, assuming you're running on CI and - besides the emulator's sluggishness, wish to overcome the System UI isn't responding alert appearing upon boot completion (as suggested by the title) -- may I suggest this bash script (gist):
#!/bin/bash
echo ""
echo "[Waiting for launcher to start]"
LAUNCHER_READY=
while [[ -z ${LAUNCHER_READY} ]]; do
UI_FOCUS=`adb shell dumpsys window windows 2>/dev/null | grep -i mCurrentFocus`
echo "(DEBUG) Current focus: ${UI_FOCUS}"
case $UI_FOCUS in
*"Launcher"*)
LAUNCHER_READY=true
;;
"")
echo "Waiting for window service..."
sleep 3
;;
*"Not Responding"*)
echo "Detected an ANR! Dismissing..."
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_DPAD_DOWN
adb shell input keyevent KEYCODE_ENTER
;;
*)
echo "Waiting for launcher..."
sleep 3
;;
esac
done
echo "Launcher is ready :-)"
The script awaits for the launcher to become ready and in-focus, and automatically dismisses system responsiveness alerts, coming its way.
It in no way addresses the emulator's sluggishness, however.
See this answer from another question to fix the ADB error. However, this will likely not fix the responsiveness of your emulator.
The emulator tends to function extremely slowly if you are compiling aosp for a different architecture than your host machine. If you are building on an x86 machine an x86 build will result in a significantly faster emulator that won't eat up all of your machine's resources.
May be this answer could be helpful for someone who have made a mistake like me and could save his time.
I faced this issue on my physical device as i used an app icon of very large size (2100x2100). I resolved it by using an app icon of low size(512x512).

iPhone Simulator - Simulate a slow connection?

Is there a way to slow down the internet connection to the iPhone Simulator, so as to mimic how the App might react when you are in a slow spot on the cellular network?
How to install Apple’s Network Link Conditioner
These instructions current as of October 2019.
Warning: If you just upgraded to new version of macOS, make sure you install the very latest Network Conditioner (in Additional Tools for Xcode) or it may silently fail; that is, you will turn it on but it won’t throttle anything or drop any packets.
Update: As of Xcode 11, there may be an even simpler way to simulate network conditions on tethered devices; see this blog post. For how to affect simulated devices, continue below, as before.
Install Xcode if you don’t have it.
Open Xcode and go to Xcode › Open Developer Tool › More Developer Tools…
Download Additional Tools for Xcode (matching your current Xcode version)
Open the downloaded disk image and double-click the Network Link Conditioner .prefpane under “Hardware” to install it.
There we go!
Be sure to turn it on. You need to select a profile and enable the network conditioner.
Caveat
This won't affect localhost, so be sure to use a staging server or co-worker's computer to simulate slow network connections to an API you’re running yourself. You may find https://ngrok.com/ helpful in this regard.
"There's an app for that!" ;) Apple provides "Network Link Conditioner" preference pane that does the job quite well.
for Xcode versions prior to 4.3, the pane installer can be found in your Developer folder, e.g. "/Developer/Applications/Utilities/Network Link Conditioner", after installation, if daemon fails to start and you don't want to reboot your machine, just use sudo launchctl load /system/library/launchdaemons/com.apple.networklinkconditioner.plist
if you are already done with Developer folder, you can install the pane as a part of "Hardware IO Tools for Xcode" package available via Mac Dev Center additional downloads section.
Link to download page (you must log in with your Apple ID): https://developer.apple.com/downloads/index.action
(credits to #nverinaud)
An app called SpeedLimit
https://github.com/mschrag/speedlimit
Works great.
chris.
It also worth mentioning that Xcode also has a built in way for devices, not simulator.
Just go 'Devices and Simulator' (cmmd+shift+2)
Select your device
Scroll down til you find 'Device Conditions'
Set your desired profile
Hit Start
To have this working you need to install 'Network Link Conditioner' on your Mac. See steps mention in Alan's answer
I would argue that a slow connection isn't enough to simulate real-work mobile data network behaviour - since there is also much more packet loss, higher latencies and more dropped connections too.
Here is a handy script I found to configure the firewall to emulate these parameters:
http://pmilosev-notes.blogspot.com/2011/02/ios-simulator-testing-over-different.html
#!/bin/sh
if [ "$#" -ne "3" ]
then
echo "Usage:\n$0 <bandwidth in kpbs> <delay in ms> <packet loss ratio>";
exit 1
fi
BW=$1
DELAY=$2
PLR=$3
sudo ipfw pipe 1 config bw ${BW}Kbit/s delay $DELAY plr $PLR
sudo ipfw add 1 pipe 1 all from me to not me
sudo ipfw add 2 pipe 1 all from not me to me
echo "RETURN to stop connection noise"
read
sudo ipfw delete 1
sudo ipfw delete 2
exit 0
Some suggested values you can use:
Scenario
Bw (Kbit)
delay (ms)
pr (ratio)
2.5G mobile
(GPRS)
50
200
3G mobile
1000
200
0.2
VSAT
5000
500
0.2
Busy LAN on VSAT
300
500
0.4
There isn't a direct way to emulate a slow connection, unlike, say, the nice network connection emulator that blackberry developers enjoy. However, since your simulator's connection goes through your computer - you can simply focus on slowing down your computer's connection.
You'll want to achieve two things (depending upon your circumstances):
throttle your bandwidth
increase your latency
Maybe this will point you in right direction:
http://www.macosxhints.com/article.php?story=20080119112509736
There are some good open source solutions, too, but I so can't remember their names.
This question might help: How to throttle network traffic for environment simulation?
You can do it in really device through Xcode(14) settings
Debug -> Induce Device conditions -> Network Link -> select the Network you want