UI Automator viewer error : Error taking device screenshot: EOF Error taking device screenshot: EOF - automation

I am getting error while taking device screenshot from UI Automator viewer.
"Error taking device screenshot: EOF" error is getting display
enter image description here

First of all try shuting down the Appium Server or Appium Desktop as they might share the same ADB connection and cause malfunction of the software which relies on the connection. When you finish taking screenshots or inspecting UI hierarchy - start Appium again.
Consider using alternative tool like
Android Device Monitor (lives under tools folder of your Android SDK distribution)
Layout Inspector
Appium Studio

Related

Debug JS Remotely

I'm running react-native app on windows using AVD. App is ruuning without errors. But When I'm trying to debug the app remotely, it is throwing me an error saying:
Unable to connect with remote debugger
unexpected end of stream on connection
I set Debug server host & port for device to localhost:8081.
Whats going wrong?
The simplest way of debugging code is to use Chrome. You don’t need to install any other apps. on Android emulator, or shake real devices, you will see the in-app developer menu. Tap “Debug JS Remotely”. The Chrome debugger will be opened automatically. You still need to open Developer Tools in Chrome manually. Open source files in the Sources tab, you can set breakpoints here. (Update on Feb 26, 2018: due to a bug in React Native Android,
if the app says it failed to connect the debugger and the URL in Chrome is not
http://localhost:8081/debugger-ui/, change the URL to
http://localhost:8081/debugger-ui/, kill the app, and try again.)
All credit gose to this website : https://codeburst.io/react-native-debugging-tools-3a24e4e40e4

emulator-5554 unauthorized for adb devices

I'm trying to get my react-native project to run on an android emulator while on a Mac operating system. It worked fine on my windows.
On my Mac, I go to terminal and type react-native run-android and I get the error message:
$ react-native run-android
Scanning 616 folders for symlinks in /Users/John/Documents/myreactnativeproject/node_modules (17ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
I type adb devices and I see
List of devices attached
emulator-5554 unauthorized
I go into the settings of my android emulator, I go to Settings Build Number to tap it several times to enable Developer options. In developer options, I enabled USB debugging, disabled Verify apps over USB, and left everything else as default. I shut down my android studio and emulator, restarted it. But still, the same issues mentioned above.
What am I doing wrong?
EDIT
I just connected my android phone to my Mac. When I run adb devices, I see this result
List of devices attached
YLEDU16B18004313 device
But when I run react-native run-android, I get the same error as above. So maybe there is something wrong with my react-native set up instead?
EDIT 2
I was able to deploy the app to my android phone by adding these extra steps
chmod 755 android/gradlew
For some reason, when I type echo $ANDROID_HOME into the terminal, I get the result /Users/John/Library/Android/sdk. But if I add the echo $ANDROID_HOME line to my android/gradlew file, it echoes nothing. And when I run the react-native run-android command, the compiler complains that ANDROID_HOME is not defined. So I have to type export ANDROID_HOME=/Users/John/Library/Android/sdk again, then running the react-native run-android command works and deploys it to my phone.
However, my emulator still doesn't work. The new error message I get is that Skipping device 'emulator-5554' (emulator-5554): Device is UNAUTHORIZED,.
But at least I have a temporary solution, and to debug with my phone.
EDIT 3
I got rid of the emulator 5554 unauthorized error by going into my Android Virtual Devices and deleting the virtual device. Then I re-installed it. And now my adb devices shows emulator 5554 device. And I am not able to deploy the app to my emulator.
In my case, Create a Virtual Device with Google APIs Image, not Google Play Image worked for me.
The problem occurs the only emulator that runs on Android Pie others don't.
In Android Studio
Open an Android Virtual Device Manager.
Create a new Virtual Device.
Select any Hardware you want.
Select any System Image which the Target is "(Google APIs)" not "(Google Play)" (If you don't found. Try to look at "x86 Images" tab or "Other Images" tab)
Done!
Android emulators have by default "Usb Debugging" in settings. You just need to wipe the data of the emulator. Do the following steps. It will work :---
Close the emulator and run the command adb kill-server in the command prompt. If adb is not set in you path then you might run this command from directory where adb is present.
Click on Wipe Data option from avd Actions menu.
Now run the emulator. It should work.
create new Virtual Device, and make sure you choose Google API's.
run the new device!. this should work
In my case, following steps worked
Wipe data from avd manager
Cold boot now
I managed to authenticate the adb on a Pixel 2, Android 9.0 (Google Play), API 28, x86_64 virtual device (Intel HAXM). The problem should be related to the Extended Controls (the 3 dots bottom icon menu, when the virtual device is booted), the Google Play menu, that is checking the version of the Google Play services. When adb is not 'unauthorized', this page is displaying the correct version, and the Update button opens inside the phone the Play Store with the Play Services app, so you can update it.
The steps I took to be able to authenticate are:
Make sure the USB debugging is turned ON in Dev setting
Revoke the USB debugging authorizations
Make sure the Extended Controls > Settings > Advanced > Open GL options are set to the: 'Desktop native OpenGL' and 'Renderer maximum (up to OpenGL ES 3.1)', so the emulator interface, animations, etc, are fast!
Power off the emulator
In 'Your Virtual Devices' in Android Studio, click the down arrow in Actions > Select 'Cold Boot Now'
When the device boot, you have to be fast, the dialog to remember and accept the USB connection will show and disappear for like less than 1 second (again I guess related to some automation scripts kicking, idn).
If you manage to click the 'remember' and 'ok' checkbox and button before the dialog disappears, you are done. Else you have to Power Off and Cold Boot again.
After that, don't wipe your emulator, else you'll have to do that insane race clicking again!
I run adb kill-server and adb devices.
the device will back again.
for Emulator, the default settings is debug enabled
Creating an emulator with graphics set to "Software - GLES 2.0" worked for me (Nexus 6 image).
I was initially using a Nexus 5X image which didn't allow me to select the graphics option.
NOTE: I went through the steps mentioned in EDIT 2 and EDIT 3 by the OP before doing this.
This can happen if USB debugging is not enabled on the emulator device.
Go to the emulated device, enable the Developer options and enable USB debugging.
I had to create a new emulator with Google Api. Wiping data didn't work for me.
2022 answer
What a shame of thread: so many "answers", comments and upvotes and none worked. Nobody simply mentioned that the "adb unauthorized" is caused by the adb keys stored in ~/.android/adbkey and ~/.android/adbkey.pub After deleting and recreating them, the problem was solved.
Credit: Android Emulator Unauthorized
I got my mac system to deploy a react-native build to my physical phone by following Edit 2 in the question.
I got my mac system to deploy a react-native build to my emulator by following Edit 3 in the question.
I think the issue was generally caused by moving my project from a Windows dev area to Mac dev area. Then probably a combination of different issues happened that cause builds to fail for each situation.
Deleting emulator and creating it again helped me on Ubuntu
I solved Problem
add ANDROID_SDK_HOME to environment variable
ANDROID_SDK_HOME = D:\sdk
and unplug device
and use new cmd

Appcelerator/ Titanium Alloy - No Andriod SDKs were found under the specified SDK Location

I am running Appcelerator on OSX.
When I try to set up an emulator on the Appcelerator IDE, by clicking:
"Run Configurations..." >
"Appcekerator Android Emulator - appname" >
"Emulator"
On the bottom of the screen it shows up with an error message saying:
Problems detected with the SDK settings. Click here for details
Upon clicking for more details, it shows the error message:
An error was detected with the SDKs configuration
Reason:
[Android SDK Home] No Android SDKs were found under the specified SDK location
The value i have put for Android SDK home was:
/Users/username/Library/Android/sdk
How do I solve this issue?
Instead of using the Emulator which are slow and heavy in terms of Memory Usage, I would suggest you to use the GenyMotion for Android which is quite fast and easy to use and has close features to a physical device.
But First this First, setup the Android SDK for Appcelerator through Preference > Platform > Android and browse the Android SDK folder and Android NDK.
Note : This can be anywhere in the system folder.
You can download the GenyMotion Tool from the below link : https://www.genymotion.com/fun-zone/
Setting up the tool is quite simple and is given in the image itself.
Good Luck, Cheers
I had the same problem as above. I did move my Android SDK home out of '~/Library/' folder.
Previously it was:
'~/Library/android-sdk-macosx'
Then i moved it like:
'~/android-sdk-macosx/'
Most probably, the Library folder not visible to AppceleratorStudio. My guess.
Thanks a lot, guys.

App.focus(iOS Simulator) doesn't work

Im currently tring to automate ipa builds with iPhone Simulator. As I use sikuli for my automation, I need the simulator window to be 'on top' for the script to run. But when I useApp.focus(iOS Simulator) , it doesn't bring the simulator window on top, rather gives an error as
[log] App.focus ios simulator(0) #0
[log] openApp: "ios simulator"
[error] App.focus failed: ios simulator not found
But the same works if I use it to focus either the Terminal or iTunes!
Can you advice as how to proceed..
If I recall right, App.focus() takes a string for its parameter. So, it should be App.focus("iOS Simulator") (with quotes) Also, sikuli has issues with focusing on minimized windows, so you should make sure it's not minimized...
edit:
I'm noticing too, that your log entry just before says you opened the app. Have you double checked that the proper app is actually opening?

ERROR : Invalid "--device-id"

I am facing a problem while running my app from titanium studio. my previous app was running properly but i created new project and then when i try to run my app, it says
[ERROR] : Invalid "--device-id" value "AVD"
For help, run: titanium help build
[ERROR] Application Installer abnormal process termination. Process exit value was 1
here AVD is my android virtual device name. my device is running properly.
Possible reasons and solutions
Bug in the Android SDK
There was a bug in the Android SDK which is already fixed. The fix was released with Android SDK-Tools 22.6.2. Here are some more information from the Appcelerator Bugtracker.
The (real) device doesn't trust your computer
The USB-Debugging is active on you device, so It is displayed in the device list, but the device doesn't trust your computer. To fix that unplug the device and plug It again. Wait for the trust this computer dialog and click ok.
Corrupted / Wrong "run config"
Sometimes it happens that the run configurations gets corrupted or you have added a wrong one. In this case you can delete the configuration under "Run Configuration":
Click the arrow with the current device
Click on "Run Configuration"
Select the not working configuration (e.g. under Titanium Android Emulator)
Click on the red "X" Close the dialog
and "run" the device again