I am using Android Studio for development.
I have a remote Android-powered device which I access using ADB over TCPIP. This device has a firewall so I need to enable specific ports for my need during development. I have enabled port 5555 so that ADB is able to connect there, but I don't find information which port is the Screen Capture using. At the moment when I press the button in Android Studio to get Screen Capture from the device, it opens a progress bar and never stops "loading".
I stop it by disconnecting ADB from command line.
I cannot connect over USB to this device so I don't know if it has even a restriction for providing capture (I read there is such restriction for some phones).
Related
I'm new to android studio and have just made a new app, which uses position sensors.
All is well when the device is usb connected to the debugger. When I unplug the cable, the app runs fine and I can wave the device around, going to a different room etc. .
But when the app is restarted without that cable, it is "waiting for debugger", which is a little annoying at that point.
I have seen this https://developer.android.com/studio/run#changing-variant but that way I need to sign the app, and I fail on that.
Is there a way to run the app without signing it, and without that debugger cable?
To be more precise in view of the two answers that suggested wi-fi connections (which I can't verify at the moment because the box running AS doesn't have wf-fi connection).
I want to test the app even without debugging, and test it by changing location, too. So I would have to set up a wi-fi connection that would connect to AS over really long distances.
Instead I just want to tell the app (or the device): forget about the debugger.
This: https://stackoverflow.com/a/56541740/4142984 solved my problem.
For the first time you must need to connect device to the android adb and after that you can remove it and still get connection to the android adb.
you should install Android Wifi ADB
you need to connect first time your device with cable in usb debug mode and by using this plugin you can connect your device on the wifi after that you can remove the cable from the system and you will get connected your device to the Android Studio
Note : make sure your system and mobile device must be connected with the same wifi network.
1.Download android-sdk-platform-tools
2. Add the path to environment variables
3. Connect your phone to usb cable
4. Connect your phone and computer in same network(WiFi)\
Now in cmd
5.adb tcpip 5555
6. adb connect *your_phone_ip*:5555
Now you can unplug the usb cable.
I installed the Android WiFi ADB plugin to run the app wirelessly. But it's not working it's giving error that Phone and PC should be connected on the same network. I use my phone hotspot to run the internet on my PC. Then I use another phone but then also same error. Someone says it will not work because you use the mobile hotspot for an internet connection on your PC. But when I try to connect another phone then also the same issue. But the same way my friend also does. he also uses the internet using a mobile hotspot but it's working fine on his phone. I have a POCO F1 Phone.
I'm answering this hoping this may help others as well as I find it helpful for my use.
First, Turn on ADB in your phone's developer options. You can search Your_phone_model developer options to find that.
Second, After turning on ADB, Connect your phone with data cable to your laptop/desktop.
Open a Command prompt window, Type adb tcpip 5555, Press allow in adb prompt shown in your phone, it will show restarting adb in tcpip mode. Now, disconnect the USB cable. You can use different port number to connect another device.
Type adb connect your_phone_ip:5555 as for example adb connect 192.168.43.1:5555 in case of hotspot. You can check Phone's IP in WIFI's advanced setting of your phone or in status section.
Now, Everytime your device restarts, repeat steps 3-4.
You can also make a script, just type adb connect your_phone_ip:5555 in a notepad file, save it as name.bat file, right click on it and send to desktop (create shortcut), in the settings on the shortcut, set any shortcut keys. Now, anytime you want to connect, just press the shortcut keys. That's how I do it. You can further open Android studio by this script so it will open Android Studio as well.
Remember, whenever it says Device is Offline, restarts your phone's wifi and reconnect it.
I am developing an app for Android that controls a robot using the FTC SDK, and I need to be able to make small changes to motor values in the code and re-install it to test the new code. My problem is that I need to do this a lot of times, and the system of taking the phone out of the mount (which takes a while) and plugging it into my computer to upload, waiting for it to upload, turning off the power to the robot, plugging the phone back in to the robot, and turning the power back on has started slowing our progress down a lot. I was wondering if there was any way I could install the new code on the phone without taking it out of the mount.
Our phone is connected to a usb hub with a webcam and the hardware controller, so I was wondering if attaching a wireless usb transmitter to the hub and my computer would still let the phone show up on the android studio connections manager and let me install it.
So if anyone has done this before, or knows about any way to make this work, thank you for the help!
Yes. First make sure that the robot phone has developer mode and USB debug enabled.
(Do this by going to settings -> software info and click on build number ten times, then go settings -> developer options and enable USB Debug)
Then, go into the robot controller phone and under the three dots at the top right select program and manage. Connect your computer to the shown internet name and password.
Next if you are on Windows plug in the phone and run the following code in command prompt,
pushd "%userprofile%\AppData\Local\Android\sdk\platform-tools"
adb disconnect
adb tcpip 5555
adb connect 192.168.49.1
popd
PAUSE
If you are on Mac plug in the device and run the following code in terminal,
cd ~/Library/Android/sdk/platform-tools
./adb disconnect
./adb tcpip 5555
./adb connect 192.168.49.1:5555
Finally, disconnect the phone, go back to android studio and happy wireless coding.
As the title suggests, I would like to analyze the bluetooth traffic of my android device on wireshark, I was able to do that just a few hours ago by just connecting the Android device via usb and opening up wireshark, the android bluetooth interface would just shouw up and worked perfectly, after some time (I rebooted the phone and did a couple other things), the bluetooth interface was gone. I'm now able to only access the phone Logcat.
I think I disabled something, or have to do some steps in order to activate this feature, that I had activated before without knowing, but I can't seem to replicate that, and the only things I find online are about saving HCI log in a file and then analyzing them on wireshark, which is not ehat I'm looking for right now
I too was looking for a way to do this and I think the best way I've found so far is to use wireshark's androiddump tool: https://www.wireshark.org/docs/man-pages/androiddump.html
It's built in with wireshark and if your phone is plugged in with adb installed and configured correctly so that you can do an adb shell from your computer, then when you open wireshark your android's bluetooth interface should show up as possible source of capture as soon as you open wireshark.
You were probably using Wireshark extcap androiddump option which has three requirements:
rooted device
developer option Bluetooth HCI snoop enabled
adb server running
From your description, you simply opened wireshark and did not start Android server
Please do the following:
enable developer option Bluetooth HCI snoop - you can do so by
tapping your device serial number in your settings menu
From your terminal execute the following command: $adb start-server when you are finished you can use $adb kill-server
I'm using the Android wifi ADB plugin for Android Studio to connect my phone to my laptop for development purposes. The plug-in is great and does what it's supposed to.
However, I have to set up the ADB via USB every time I start Android Studio.
Clicking on the plug in icon states that there are no connected devices and to review my USB connection.
This also happens if I don't use the ADB for some time.
Is there any way to connect via wifi seamlessly?