I have set up a virtual machine running an Android 4.4 system on VirtualBox, in a Windows 7 system, for convenience in testing an Android app I am trying to develop. What last remains, is to be able to make the guest Android OS look like it's connected to the host via USB, to be able to use USB Debugging. Is there a way to achieve that?
EDIT: By "convenience" I mean I do not have a good enough physical device at my hands at the moment, and my processor happens not to support VT-x, in which case I could just use an AVD with Android Studio. Therefore, the VirtualBox choice is the next best thing I got, until I get a new device on my hands. What has priority at the moment is to create the app's utility, looks will be taken care of later on.
If your Android system is rooted you can install Wifi ADB (or some similar application) through Android Play store and debug over TCP.
The steps can be simply:
Install Wifi ADB (from https://play.google.com/store/apps/details?id=com.ttxapps.wifiadb&hl=es)
Execute and start service (Bettle will go to green)
Open Command line in Windows 7 machine
Run the connection command, for example:
adb connect 192.168.125.232
Test device connection with
adb devices
Enjoy testing your application!
Related
I am using Android 6 Marshmellow.
I need to perform a local backup on Whatsapp without access to the screen. The motherboard has been damaged possibly beyond repair. The net result: Nothing displays on the screen. I have tried Windows 10 programs that display the Android screen in a window on PC but they don't work - possibly because the phone is failing to produce an output in the first place.
One program I used is this but the screenshot that the java app takes is pitch black. Hence my assumption the motherboard is incapable of producing a display at all.
Therefore, I would like to know if there is a way to execute app-specific commands such as telling Whatsapp to create a local backup via adb tools. So use Whatsapp via the Windows command line, through adb, as you can on Linux.
I cannot interact with the display; touch inputs are not registered. It has a password but the phone is not encrypted. My Windows 10 PC is a trusted PC and the phone has developer tools on.
More info here.
If you set that phone up for development and you can use adb commands to install an app (and send other intents), you might be able to try this out: Vysor
You can test this by simply turning on your phone, plug it in via USB cable and then run "adb devices" on your PC. Make sure adb.exe is in your Window's path.
Download the Windows app, install it and run it. Then plug in your phone. If this phone has developer options enabled and has been white-listed for the particular PC you're using, then it should allow the Windows app to install the Vysor Android app and start it. Once that happens, it should be able to connect and you'll see the phone's screen on your PC. Try it out with a working phone first if you like.
Good luck!
Find your emulator device ID. Run C:>adb devices
Find the package you want to debug. Run adb shell pm list packages .
Set the app to debug at startup (note the -w)
Start the app in the emulator.
Connect Android Studio Debugger.
Point to source code and set breakpoints.
I am running an emulated Nexus 5 running Android 5.1.0 on Xamarin, and I cannot for the life of me get adb to recognize the emulator as a device. The only way I can get the device to connect is through TCP/IP, connecting to the emulator's given IP address manually.
I've tried reinstalling the Android SDK, Xamarin, and VirtualBox (which the Xamarin emulator uses), as well as tweaking several settings in each, all of which lead to nothing.
And no, running
adb kill-server
adb start-server
does NOT fix the issue, like every other thread I've seen has suggested as the only fix.
I look forward to your help, and thank you in advance!
EDIT: Additionally, I should add that adb devices DOES recognize my physical Android device when connected through USB, but still not the emulated device.
If you are using Xamarin Android Player. Try following steps
Shut down the emulated device.
Open Oracle VM virtual box manager
Identify emulated device and open settings.
Go to USB tab and Enable USB Controller.
Save settings. And start device from Xamarin Android Player
Try different sub options from Enable USB Controller. I enabled USB 1.1 and it worked for me. I am not sure it will work for all. Let me know your experience.
I have a very specific problem. I am trying to create an Android app for educational purposes, together with a friend of mine. The problem is, my processor does not support VT-x, which is essential for using an AVD, and my Android phone is considerably old so it can't really take much.
Therefore, the one solution I have in mind is using VirtualBox to create a 32-bit Android Virtual Machine and test my app there.
The problem is that, unlike an actual Android device and an AVD, a VirtualBox Android VM does not have, for what my knowledge is, an obvious way of being connected with Android Studio for testing each new app build.
So, what I am asking for is exactly that: a way to immediately test the app I have written in Android Studio in my Android Virtual Machine I have created on VirtualBox, including any workarounds that effectively allow me to immediately test the app on the VM, other than finding a way to make adb work with it.
I see I'm a bit late on this one but I figured it out. I am using Windows 8, running Android x86 (4.4 r1) on VirtualBox.
1. Set up a Host-Only adapter so that the VM has access to your network; You can set this up only when the Android image is off. Basically just go into your settings, click on Network, and select Host-Only Adapter in the drop-down labeled Attached to. For Adapter Type select PCnet-FAST III. Check the box next to Cable Connected if it isn't already.
2. Set up an NAT Adapter by selecting a different Adapter tab and for Attached to select NAT. For Adapter Type select PCnet-FAST III again. Check the box next to Cable Connected if it isn't already.
3. Enable Developer Mode by starting up the Android image, then going to Settings > About phone/tablet > Build Number. Click on Build Number 7 times. You should see a pop up that tells you how many more times you need to click to get into Developer mode. Credit to RMP PianoTuning's answer below
4. Get the virtual Android's IP address by going into Settings > About phone/tablet > Status > and then scrolling down until you find your local IP Address. Remember this number, you'll need it for the next step.
5. Start up Android Studio and go into the console; it should be one of the options in the bottom-left corner. Type in adb connect (IP address from step 4). Take a deep breath and hit enter. If it says
connected to (IP address)
you are ready to rock! When you run the app within Android Studio, your virtual Android should appear as Innotek GmbH VirtualBox, or something like the same. Select that puppy and enjoy your new, easy-to-test-on emulator. Its even Bluetooth Compatible! (but thats a whole 'nother story... google it)
Now a virtualbox isn't an answer to your need.
here are some alternatives,
Genymotion http://www.genymotion.com/ which is an easy to use android emulator , i suggest you look into it. based on virtualbox , can be integrated into android studio with ease . needs an AMD-V proc if not a VT-x . If the processor does not support these, the emulator still works, but your emulated device will only be able to use one CPU.
The other option is adb over wifi, which will let you use your phone without doing the dropbox step http://forum.xda-developers.com/showthread.php?t=1685736. For this to work you will need root though.
I was able to follow OMiKeY steps and get my app to run in VirtualBox,
the part he leaves out:
In your Android simulated device, you have to enable Developer mode.
Goto 'Settings' -> About Phone/Tablet->Build Number.
click on Build Number 7 times.
For me I got pop up that told me how many more times I needed to click to get into Developer mode.
After that i re ran the adb connect XXX.XXX.XXX.XXX command
Here's how it works for me.
I just connect my android phone with USB to my host (Windows 10).
Then make sure the USB phone is found from within the guest OS (ubuntu desktop 18.04 in VirtualBox 6.0). (VirtualbBox app: Devices > USB > check the USB corresponding to my phone). Once it's recognized by ubuntu, there will be a phone icon showing up on the desktop screen.
Next, I start android studio (v3.3.2); once that is complete, from the Terminal window (Android studio: View > Tool Windows > Terminal), I type in: adb devices, which would list the devices attached and my phone is on the list.
Now I run the app for a test (monitor my phone and confirm if there's prompt)...and the app shows up on my phone. Hope this may of help for others.
If you are running Windows, open the specific port in Firewall. In VirtualBox in your Android instalation Settings->Network Adapter 2 Tab - Port Fowarding and create a rule with Protocol (TCP) - Host IP (Your IP) - Host Port (in my case 5555) - Guest IP (Same Step 4 - Check your IP ) - Guest Port (I put the 5555 too). Ok! Now I can run my Apps in VM.
AppData\Local\Android\Sdk\platform-tools>adb connect 192.168.0.101
connected to 192.168.0.101:5555
Running devices:
innotek GmbH VirtualBox
:-)
I'm about to start writing some Android applications, I have downloaded Jave/Android and Eclipse.
I have a test Android tablet (Viewsonic Viewpad 10s) which I will be running the software on.
I was hoping to be able to just plug the Android device straight into my PC to allow me to debug/run applications on the tablet.
I have purchased a male->male USB cable and plugged it into both devices, but nothing happens, it doesn't even come up with an 'unknown device' in the 'devices' window. Is there something else I need to be doing to get Windows to recognise this device? (I'm running Windows 7 (64bit)).
Alternatively, is this the best way to be running/debugging on the tablet? I was thinking that there might be a network debugging application, as both devices are on the network?
I'm totally new to Android, so might be missing something obvious. Although I have set the 'USB Debugging' within the 'Development' menu.
Thanks in advance.
Rich.
It's a Windows problem, Windows isn't capable of recognize your tablet on its own, you need to install the appropriate USB drivers for your device in order to use your tablet when it is connected to your PC.
Under a GNU/linux distribution like Ubuntu everything is much more easier and you can just plug in your device without installing anything, you just have to set the right permissions for the device once.
Unplug the device from your machine
Install the driver for your device : http://www.viewsonic.com/support/downloads/drivers/_download/tablet/viewpad10s/ViewPad_10s_USB_driver.zip
Plug your device in
look at the device for a notificaiton saying debugging enabled.
If you dont, you will need to open Device Manager, find the listing that your computer thinks the device is and right click and uninstall it. Then unplug and replug.
I am trying to debug on a USB connection to several different Sony tablets (particularly the P, which is listed as supported). I can debug on a smart phone, but the tablet doesn't show up as a connected device when I try to run my app in Eclipse. I have checked that the settings of the tablet have Applications->Unknown sources, and Applications->Development->USB Debugging
This is a fairly common problem. You basically don't have the drivers you need for USB debugging.
There are a few different ways I've had to obtain drivers for phones. The first way you should attempt is to go into the Android SDK and AVD manager and download the Google USB driver debug package.
This may or may not give you the driver you need. If it doesn't you will have to do one of two things. One, add the device details to the driver file you just downloaded. Generally these will be posted on forums/boards discussing your Tablet/Phone type. Secondly, you can download a different driver from another source like the Tab/Phone manufacturer.
Here a Youtube video how to install Sony Tablet S & P
Or the app you are developing has set the target higher than your tablet supports. Then it also won`t show up in the AVD Manager.
In case you wont get proper drivers for your tablet you can try adb over network.
Connect your device to wifi as well as your computer.
turn on ADB over network in Options for developers (maybe some ROM dont support it). Eventualy you can enable this using specific commands on your tablet.
on your computer run terminal and use: adb connect <ip>:<port> where <ip> refers to IP of your tablet and <port> refers to port on which adb is listening (usually 5555).
run adb devices to verify that device is connected