AndroidViewClient and Genymotion emulator - android

I am setting Genymotion Android emulators and AndroidViewClient to test my app. Is AndroidViewClient able to connect to the Genymotion android emulator ?
Thanks

Genymotion behaves like a USB connected device so it should definitely be compatible with AndroidViewClient.
You need first to configure Genymotion to make it use your ADB binary from your Android SDK:
Open Genymotion > Settings > ADB
Check Use custom Android SDK tools
Specify the path to the Android SDK by clicking Browse
Click OK.
After that, you should find your Genymotion instances inside your ADB deamon. Open a command line and type: adb devices
You should get as a result, like this:
List of devices attached
192.168.56.101:5555 device
The "ip:port device" line is your Genymotion machine running.
At this moment, you can run AndroidViewClient tool.

Related

I have to run adb connect 192.168.56.101:5555 in order for android emulator to show up in list

When I start a Genymotion emulator (Android studio emulators crash android studio and dont start), I have to run adb connect 192.168.56.101:5555 in order to connect adb to the emulator. Otherwise it doesn't show up when I use adb devices. I never had to do this before and I cannot figure out why.
Looks like it has something to do with recent update in android sdk platform tools. Downgraded mine from 28.0.2 to 28.0.1 and successfully got my genymotion emulator in adb devices back.
1): Try go to SDK MANAGER in folder EXTRAS and install GOOGLE USB DRIVER
If this happens on a Linux machine you could try to Uncheck the "Use Host GPU" checkbox - in the emulator settings**

Why isn't my genymotion device listed when I run "adb devices"

I am starting my first android project using nativescript.
I want to run my project with genymotion.
In genymotion GUI settings/ADB I am using custom Android SDK tools and genymotion tells me the android SDK tools are found. Also the VirtualBox path is valid, and when I renamed the device the VirtualBox name and Genymotion name both changed. The Virtualbox VM is powered down.
I start genymotion and get the emulator open with a black screen. I then run:
tns run android
per the nativescript docs
I get as output:
Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.
I then tried running:
adb devices
and got an empty list so it seems my device is not being recognized, I just don't know why.
I have also tried running:
tns run android --emulator --geny nameOfDevice
This starts the emulator but again just a blank screen. So I guess nativescript knows about the device but adb doesnt?
Any help would be greatly appreciated and apologies in advance if I am missing some obvious android issue.
You should also make sure that your GenyMotion is using the right SDK.
Go to: >> Settings >> ADB
And choose Use custom Android SDK Tools
If the SDk path is found it will be marked with
Android SDK Tools successfully found!
Do not open genymotion before adb initialisation.
Start adb server first
by adb start-server
and then open genymotion to initialise emulator.
After that you should be able to see emulator in list of running devices through adb command. I ran into the same scenario where adb does not list emulators if genymotion is opened before adb initialisation. I hope it helps.
My working solution is:
cd /opt/genymobile/genymotion/tools
./adb devices
You have to use its own adb tool.

Android Studio to Bluestacks Connection Error

I am new to android development and was trying to use bluestacks to test my apps (as my pc won't run the emulator fast) but the bluestacks emulator is not being detected by android studio.
I started bluestacks and then ran my app. On the choose device dialog it doesn't show bluestacks.
I looked up in device monitor, but bluestacks wasn't detected there.
I also tried using adb kill-server, adb start-server, adb connect 127.0.0.1
but that didn't work as well. It says "connection could not be made as the target machine actively refused it".
All the solutions given in the other related stackoverflow post don't work. Android studio won't recognize bluestacks.
Please Help !!
Try in command prompt "netstat -anb" with administration privileges. Check if there is 127.0.0.1 5555 Estebalished.
If everything is OK then temporary disable firewall and type"adb connect 127.0.0.1:5555" should work.
i too have also gotten the error "connection could not be made as the target machine actively refused it" recently (when i tried to connect to adb using command prompt)
Trying with -> adb connect localhost:5555 or adb connect 127.0.0.1:5555 would not work. You need to identify your bluestack device ip address. You can identify the ip address using the preferences in your bluestack emulator setting. (where you enabled ADB in bluestack).
I did the following to resolve the error you had encountered and successfully connect Android studio to Bluestack. please try the following steps. (I am using windows 10, Android Studio 4.0.1, Bluestacks 4.200.)
find your android studio sdk platform tool folder. For me its is
custom installed in my D drive. for example->
D:\AppData\Local\Android\Sdk\platform-tools
right click on adb.exe
and run as administrator. (click on yes if a pop up ask if you would
like to make changes to your devices. After that you would only see
another pop up that suddenly disappear.)
open Bluestacks. Run your selected emulator (samsung/pixel etc). Ensure that
you have enable "Enable Android Debug Bridge (ADB) in the emulator
preferences.
open command prompt. cd to your platform tools folder path.
enter the following command->adb connect xxxxxxxxxxx where xxxxxx is your
device localhost ip. (see attach pic. My device ip is
127.0.0.1:xxxxx hence my command is ->adb connect 127.0.0.1:xxxxx
continue with the following command->adb devices you would see your bluestack
emulator device. same ip listed.
open your android studio. You would be able to see your bluestack emulator
[
i don't know if you fixed the issue or not but it's pretty simple to use bluestacks, if you see this screen when you open it like this all you have to do is run the app in android. it happens where android doesn't detect it because it wont see it as a device you either wait or try to get that screen (that sort of refreshs)
Just Need to do this!
Go to the SDK folder that you have got in your computer,then open the "platform-tools" folder,then open the "adb.exe" as administrator.
then try the BlueStack emulator.
if u got problem to connect with blue stack through android studio then follow following steps
in run(windows+R) put '%localappdata%\Android\Sdk\platform-tools' and check adb.exe is working correctly or not
If not then download file from
https://www.microsoft.com/en-us/download/confirmation.aspx?id=49093 which is
Update for Windows 7 for x64-based Systems (KB2999226) (related OS)
and install it.
allow adb.exe as exception in your virus scan software don't treat this exe as malware.
start your blue stack emulator.
go in setting of blue stack emulator go in preferences click checkbox 'Enable Android Debug Bridge'.
go to this location %localappdata%\Android\Sdk\platform-tools and run cmd through this location.
put command 'adb connect localhost:5555' press enter in command prompt.
start android studio then run project through play button popup will come with virtual device list, it will show your emulator's device.
...happy coding

Genymotion not displaying logs in android studio

Android studio does not display my println and Log.d calls as well as errors when I run my application with Genymotion. I have changed the emulator settings so that it uses the same sdk as android studio does. I also made sure to select logcat with my device as target and log level verbose. This problem only occurs with Genymotion, not with the default AVD emulators. I have already tried abd kill-server and adb start-server commands without any success. How could I display the logs from the emulator? Thanks
You have to use the same adb for android studio and genymotion.
In other to do that, use the same Android sdk in both.
Genymotion: Settings > ADB > Browse (to the folder).
With Android Studio 1.3, selecting Tools->Android->Enable ADB Integration did the job

Not able to connect Android Wear Emulator with Device

I am not able to connect Android Wear Emulator with my device.I have HTC One device which has 4.4 (KitKat OS).
I follow below link :
Setting up Android Wear
But, when I execute the line adb -d forward tcp:5601 tcp:5601 through command prompt,nothing happens.Android Wear emulator does not show device connected.
Note : I am able to launch the Android Wear Preview app successfully in my device and Notifications settings is also enabled.
Any help will be appreciated.
#Lance Nanek basically helped me solved this problem. In case you had the similar problem, these steps might be helpful.
run 'adb devices' , you should see two devices, one is your
emulator, the other is your device with Android Wear Preview app
installed.
you might see your emulator offline, if so, kill the emulator. From avd, start it, carefully uncheck 'launch from snapshot' - this
is contrast to Android Wear Get started instruction: "Start the AVD
again, but select Launch from snapshot and deselect Save to
snapshot."
run 'adb devices' again, make sure you do see two
devices online
run command 'adb -d forward tcp:5601 tcp:5601'
from the android wear preview app, tape connect, you should be ready
to go.
On the newly updated Android Wear app (Aug 2014) there is a settings button top right when asked to choose a device connected via bluetooth. Pressing this button will connect to an emulator instead.
Enable adb debugging in the developer options on your watch.
Enable bluetooth debugging in the developer options on your watch.
Enable bluetooth debugging in the wear app on your phone. run in terminal:
adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
See this training.
I think I also had luck with using the cradle plugged directly into the computer, but unable to confirm that now.
Android Wear using Genymotion
For people who does not have a phone with Android 4.3 or above, we can not try the Android Wear Preview. :'(
And here is a way you can try, use Genymotion Nexus 4 or any other emulator with Android 4.3 or Android 4.4 and it works!
Setup a Nexus 4 with Android 4.3 in Genymotion.
Start both the Nexus 4 and Android Wear emulator.
You should first install Google Play Services on the Nexus 4:
Download the zip file
Drag it into the Nexus 4
Reboot the device, and now you are able to install "Android Wear Preview" on Play Store
Open Terminal, use adb tools:
adb devices
you shoud see 2 devices,
adb -s [device name of Nexus 4] forward tcp:5601 tcp:5601
Done!
The trouble I was having, was that the pre-selected API level was set incorrectly. It should be set to the following values:
Using Host GPU is optional.
Stuck with the same a while ago. It appeared that Google updated their Android Wear app. After installing the new version I was able to connect successfully to wear through its interface (as long as I used device with android 4.3+ and adb -d forward tcp:5601 tcp:5601 command)
After some hours trying to find the solution... I've found it!
In my case, the problem was that I have two different SDKs (one from Eclipse and the other from Android Studio), so I was trying to execute the ADB commands in the wrong one.
So it is important that you check the path you are using in your IDE and execute the commands on the same.
I was getting suck on "Connecting to Emulator", but I fixed it by using an Android Wear ARM virtual device instead of an x86 one.
Run the adb -d forward tcp:5601 tcp:5601 command in super user mode

Categories

Resources