When I try to run my application via Android Studio on a virtual device, or a physical device, my Kotlin app runs the first time, but afterwards I need to disconnect my device each time I want to publish it again.
When I click on "Run App" it just says "Install" an the bottom. When I click it, it says "Launching App". I've had this problem for some time now, and I hope somebody knows the solution for this.
I've tried rebooting and turning USB-debugging off and on. Both work the first time install, just like disconnecting and reconnecting the device. After that however, again it keeps getting stuck on "Installing".
On a virtual device u could try to Open AVD Manager and then click on Wipe Data from dropDown list in actions column
Related
Hi all i am trying to launch Desktop Head Unit(DHU) using android ADB.
I have followed all steps what mentioned in installing DHU steps.
But i am getting following error.
Please some body help me how to resolve this.
Make sure you perform the following steps:
Make sure developer mode is enabled on your phone.
Install Android Auto on your phone.
Enable developer mode by tapping on the title in the app several times quickly.
Once in developer mode, tap on the 3 dot menu on the top corner and click "Start head unit server".
Connect your device to the computer.
On your computer now, enable tcp forwarding via "adb forward tcp:5277 tcp:5277" (if this fails, you may need to call adb kill-server). You will need to perform this step any time you disconnect then reconnect your phone to the computer.
Start the DHU by calling desktop-head-unit.exe
"Developer Mode
Finally, a note about developer mode, since a few people will certainly ask. It's still there and accessible in basically the same way. Instead of tapping several times on the lead image, you'll want to give ten quick taps right on the words "Android Auto" in the action bar. Just like before, a toast message will confirm that it worked. But don't expect anything new in the developer options screen, it's identical to the previous version."
AndroidPolice
Enjoy your Android car development ;)
First connect your phone to computer then open android auto on your phone click menu icon(you need to enable developer mode on app first) click start head unit server.Try to open DHU on your computer.
I am trying to debug my android application on a device but it is not showing me any device connected in the chooser dialog. What could be the problem ?
I've tried to change connect and disconnect the device again.
I restarted the eclipse
I checked Window->Preferences->Android it shows me the SDK Targets.
What else can I do. My Computer recognizes the device but the eclipse chooser dialog doesn't show any device connected.
Please help...
There is a third party software named "moborobo" : http://www.moborobo.com/
You can install this there after you didn't need any driver for any perticular mobile device...it will automatically gets detected and you can choose it from the dialogue box. Hope this will help.
Check that your device connected as PTP device(Camera). Notification Bar -> USB Connection.
If your device connected as MTP(as common data storage) then AndroidStudio don't recognize it as debuggable device. At least that works for me and my Nexus.
There is another method that you can use .....when you run your project as android project, it generates an .apk file. Just move that .apk file to your device. Then on device run the application in debug mode.
What you can try is: killing adb.exe (using Windows Task Manager) (your IDE will restart it when needed automatically)
If you have more than one IDE open (for instance eclipse and Android-Studio): shutdown one of them, because there may have some conflicts between them when trying to connect with ADB.
If your device was never recognized through ADB (never shows up in eclipse chooser dialog, nor in Android-Studio chooser dialog): then you can try to install the generic Android Driver provided by Google (<SDK_HOME>/extras/google/usb_driver/)
I often encounter this problem, particularly when starting a particular emulator device for the first time that day. i.e. I launch my app, choose the device, the device starts up - but not before the launch of my app has timed out. I find that although the emulator device appears to have started properly - Eclipse does not recognise it as a "running Android device".
I simply shut down the device and repeat the process. I find that the second attempt is (almost) always successful - even if the app launch "times out", the emulator will be talking to Eclipse and I can then relaunch my app on the running emulator device.
Increasing the ADB connection timeout (defaults to 5000ms: Window...Preferences...Android...DDMS) may or may not help.
Hope this helps !
Whenever I run my emulator for the first time, it shows up but doesnt start my app and I find no device in DDMS view UNTIL I reset the ADB. It happens always FOR THE FIRST TIME. But after I reset the ADB it works from then on.
Uninstall and reinstall Android on your system.
At this moment, this error started with IDEA 11. I still did not find the right pattern but if a device or emulator are idle for a specific period of time (not long) and if I then try to push the project to a device/emulator and to attach a debugger, first appears a message that IDEA is trying to connect to ADB (a several message windows) and then the upload starts, the apps gets uploaded, then it fails with error:
Launching application: com.xxx/com.xxx.sMain.
DEVICE SHELL COMMAND: am start -D -n "com.xxx/com.xxx.Main"
I/O Error: Connection refused
The only solution is to close both emulator and IDEA or to disconnect a real device from USB cable.
Any ideas why this is happening? As I said it happened with both device and emulator so I cannot tell that it's up to a device/emulator.
EDIT
I tried restarting ADB via shell, it did not help either. This does not happen when I simply run the project, but only when I press debug.
EDIT 2 (18May)
I've noticed that this is happening when two IDEA's screens are opened in the same time. For example, I open another project and choose to open it in new window. I first run the app in window 1, and then in window 2, but then the popup "Trying to attach to ADB" keeps opening and closing. I see that memory increases for a couple of MB as each time a new popup is created. this leads to IDEA stop responding and I have to kill it.
I think this is a new bug.
I am trying to use Logcat to help diagnose my android issues. I frequently have a phone plugged in AND an emulator running. Sometimes I debug on the emulator, sometimes I debug on the phone, or maybe even a third device.
Logcat does not continue to show messages after a device is switched. How can I specify what Logcat does or force it to resume logging without restarting eclipse?
Insight appreciated
I've noticed this at times. Usually one of two things does the trick. First, open the Devices view, verify that the new device is showing, and then switch back to Logcat. That seems to kick Logcat into action again.
If that doesn't work, then in the Devices view menu, select "Restart ADB" (I think that's what it's called; I don't have it open at the moment).
If even that doesn't work, then kill and restart the ADB server from the command line and repeat the above.
If you are using Eclipse, switch to the DDMS perspective.
There, logcat will be showing the log of the selected device in the devices View
(Window -> Open perspective -> Other -> DDMS)
You coupld use the CLI for ADB and reattach the debug process to your switched device. Then Logcat will pick the debug msgs from that connected device. Whatever device is actively connected to ADB will output through Logcat