Eclipse - Empty Logcat with Android 7 - android

I recently updated my Nexus 9 Tablet to Android 7 Nougat.
Since then the Logcat view in Eclipse stoped displaying Logcat messages, the view just stays empty.
Also the devices target is shown as "Unknown".
If I instead start Logcat outside Eclipse (AndroidSDK->tools->ddms) it displays all messages. However, then the "Application" Column stays empty.
There are allready some (older) questions on this topic here on SO, but none of the solutions here worked for me.
What i tryed:
Use another USB Port
Focus the device in the DDMS perspective
Restart Eclipse
Reboot the device + pc
abd kill-server
disable and re-enabled USB Debuging on the device
Reset the USB-Debuging authorization and confirm the RSA fingerprint again
Switch USB-Mode to "MTP"
Every installed package from the Android SDK is up to date and i use latest Eclipse+ADT Plugin.
Also everything works fine with my Galaxy S5 Mini (Android 5.1.1).
I know, that the ADT-Plugin is deprecated and we should use Android Studio.
However I still preffer to use Eclipse as long as possible, so I am looking for a solution for this problem.
So does anyone know how to solve this issue?

I tried with this custom build and it works for me. Now I can see my logcat in Eclipse again.
https://github.com/khaledev/ADT/releases
Download the zip file then in Eclipse menu Help > Install New Software... > Add > Archive...
Just pick the downloaded zip and do the rest of the install process.

can use "Android Device Monitor" Application,
This application in the sdk-tools package.
Launch From the command line,
cd to the "sdk-tools folder/tools/" directory,
enter the following command : monitor.
or
windows environment,
open the directory "sdk-tools folder/tools/",
and double click monitor.bat.
detail -> Google User Guide

I had the same problem. Eventually, I found out that the "Eclipse IDE for Android Developers" was out of date. Updating this feature fixed the problem. Procedure:
Open Help -> About Eclipse -> Installation Details
Select "Installed Software" tab
Select "Eclipse IDE for Android Developers"
Click "Update" in the bottom.

Try to launch directly sdk tool monitor from Android SDK, it can be found in:
sdk-tools folder/tools/
you'll see monitor.bat, click on it to launch Android Device Monitor oustside Eclipse, don't forget to create a filter for your APP, go to logcat window-> Saved filters -> + -> fill your app name in "by Aplication Name"
If nothing works, in an emergency, you may try this to get logcat over command line (use cmd in windows), type :
adb logcat --pid=YOUR_APP_PID_NUMER
this shows messages from your APP. if you don't know your PID, put a line in your APP code:
System.out.println("foo stuff I can find easily when I read logcat results");
Run your app, make sure you get the up line executed.
Then in your command line type:
adb -d logcat System.out:I *:S
Find your line System.out.println("foo... and read the PID number, is next right to time data.
And then
adb logcat --pid=pid number you read from your comment line
to get logcat messages from your app in the command shell in real-time.
If you just want messages output till now, just add -d modifier:
adb -d logcat --pid=pid number you read from your comment line

Related

Not able to debug app on android device - Android Studio 2.0

I am not able to debug an app on my device (Asus Zenphone 2) after I updated android studio to 2.0. I keep seeing below message in debug tab right after I click on debug icon in Android studio.
Message in debug tab in Android Studio UI
---------------------------------------------------------------
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename
I keep seeing Alert Dialog with the title "Waiting for Debugger" and Force close button all the time.
I searched but it seems only two results from google for that message.
I restarted Android studio, checked developer settings on phone...
Have anyone faced with this issue. Please help me. I cannot run the emulator, because my mac will be too lag. Thank you in advance.
The problem is that after installing and starting to launch the app, that debugger client that AndroidStudio starts is unable to connect to the debugger server on the device. This can have many causes, see this answer and the other answer shown on this page and see if one solves the problem for you
To help figure out the problem, look at the 'Console' tab of the 'Debugger' window in AS. One of the first few lines should look like this:
$ adb shell am start -n "com.acme.audtest/com.acme.AudTest" -a
android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Cut and paste that line into a command prompt, REMOVE THE '-D', and execute it.
It your app ('AudTest') comes up without error, the problem is in AS, is communication to the device, or the configuration of the device. If the app doesn't start, it is in the .apk. (Not the complete solution, but starts to point you in the right direction -- for which of the solutions below applies to your situation.)
First I select the second option, and it worked fine. But then don't know why I change to select first option. So, the debugger shows the message Waiting for application to come online forever. And I did not notice that, just thought another app prevent me debug or that was an issue with Android Studio 2.0.
So, just check to second option will solve my issue. Thank all.
Restarting Android Studios (2.1.1) resolved this for me.
There are two possibilities:
1.USB Debugging off :
Start Developer Option of your devices
Switch On USB Debugging
2.In Android-Studio : File -> Invalidate Caches / Restart
anyone can be useful for you.Try it
The correct answer is close your Android Device Manager.
None of these suggestions worked for me till I closed it.
For me the problem was in "Android Studio" + "Intellij IDEA" running side-by-side. Was fixed by disabling bundled "Android plugin" in "Intellij IDEA".
(Note: problem appeared only with some later versions of these IDEs)
Nothing worked for me except one solution...
Clearing the Intellij IDEA (Android Studio) .idea directory which contains configuration information worked for me:
Exit Android Studio
Navigate to the project you are trying to debug
Backup any files inside .idea that you modified (if your project checks any of these into VCS)
Delete .idea directory
Open the project in Android Studio
I had to remove the parameter
android:exported = "false"
from the main activity.
if you get this problem on the emulator, running adb reconnect worked for me. there is a similar command for devices adb reconnect device
**
This answer might help for those Who have successfully connected their
device along netbeans NB Android but on debug there's no application
being appear on device.
**
Ok so solution is check your android device version in mobile setting click on about device at last: you will know your android version there.
Now choose the same version for your netbeans android project.
Right click on project name click on properties and then change target with same as your android device.
(In my case android version was 4.4.2 so I selected the same for my project target)
Before to go ahead click on service tab next to project tab in netbeans then right click on Android device and click on restart ADB.
Finally you need to right click on project again and click on clear and build.
Now you can run with hope to get result.
I just wanted to share my experience as I had the same error and there was no way to solve it using all the solutions you guys posted. I even deleted several times my virtual device, no way to make it work again.
In my App I have a custom permission com.example.CUSTOM_PERMISSION and I wanted to use it to protect my Main Activty from a confused deputy attack.
<permission android:name="com.example.CUSTOM_PERMISSION"
android:label="#string/permlab_deadlyActivity"
android:description="#string/permdesc_deadlyActivity"
android:permissionGroup="android.permission-group.COST_MONEY"
android:protectionLevel="dangerous" />
.
.
.
<activity
android:permission="com.example.CUSTOM_PERMISSION"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Somehow that property android:permission was preventing my app to install and run on the virtual device, even though it could be compiled and build with Gradle successfully.
Just after removing it, everything is fine again
I am not sure the app is protected this way, I'm building another test app to try performing a confuse deputy and see if the declaration of the custom is just enough.
Hope this can help somebody that was getting mad like me!
I had this problem in the Android emulator, and it was solved by going to Tools->AVD Manager, selecting the device, right click "Cold Boot Now".
The solution which helped me is to click on attach the debugger to android Process and set debugger to java.
Just throwing my experience in as this just started happening. With regards to all these answers, I tried a few of them and none seemed to work. So I started from scratch:
Initial setup:
- USB Debugging ENABLED
- Always prompt when connecting to USB (I usually only connect in charge mode)
- Allow ADB debugging in charge only mode ENABLED
- Wait for debugger DISABLED
- Verify apps over USB ENABLED
The steps I took to get debugging back:
Close down Android Studio - I didn't go so far as to delete the .idea folder as discussed, but I'm sure it couldn't hurt.
DISABLE USB Debugging
Revoke USB debugging authorizations
Reconnect Device
$ adb devices
> <Device Id> unauthorized
ENABLED USB Debugging
Reconnect Device
When prompted select ALLOW (I clicked always allow)
$ adb devices
> <Device Id> device
Open Android Studio and hit debug - Application started successfully, I was still getting 5-6 of these messages but then it worked:
$ adb shell am start -n "com.exampleapp/com.exampleapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Connecting to com.exampleapp
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
React Native
As a side note - this happens every so often, I'm not sure whether it's from switching back and forth between running from react-native run-android or debugging in Android Studio, but regardless I've had to do this a couple times (finally decided to document).
Also remember
$ adb reverse tcp:8081 tcp:8081
and to start the packager when debugging (I tend to forget).
Try to restart ADB. Execute terminal commands:
adb kill-server
adb start-server
I had this problem and none of the solutions provided worked for me.
I you had the same issue, you can also try this:
Edit Run/Debug configurations
Select the 'app' or other name's configuration
At the launch Options, change Launch "Nothing" to "Default Activity".
Steps

Device unauthorized after accepting RSA fingerprint

I have been trying to use my Nexus 5 as a debuggable device when working with Android Studio. I have used several different resources to get the device to display the RSA fingerprint (which I have accepted), but the device remains "unauthorized". I am currently running ubuntu 12.04 on a Dell XPS-13.
My desktop computer running Windows 7 has had no issues is instantly recognized and a valid debuggable device.
One issue I had just recognized after weeks of trying to get this to work is that in the AVD manager, under the Compatible column for this device when UNAUTHORIZED it says: No,minSDK(API8) > deviceSDK(API 1). I wonder if this could be related as the device is currently up to date.
Here are some of the things I have tried:
Updated 51-android.rules document with the following line, made executable:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0666", GROUP="john"
Series of adb kill/start-server commands
Accepted the RSA fingerprint in one single instance and permanently, deleted the key/re-accepted it.
Checked permissions of usb slot.
Changed device from media device to camera and back (this actually sometimes lets the "adb devices" command return a value of device for the phone, but then the abd process locks and crashes).
I haven't really seen anyone with the issue where they were able to accept the RSA fingerprint but the device remains unauthorized, or that the AVD manager reports deviceSDK(API 1).
Any help is greatly appreciated, thanks!
Edit: It should be noted that I'm a bit of a linux noob so keep that in mind.
I have also experienced this problem after upgrading from an earlier version of Android Studio to the latest 1.0 release.
My phone was in the "Unauthorized" state and the compatible column said
"No, minSdk(API18) > deviceSdk(API1)"
I fixed my issue with the following steps:
Firstly, when I upgraded Android Studio I inadvertently moved the SDK directory.
To make sure your SDK folder and environment variables match up, open the command prompt and run the following command:
echo %ANDROID_SDK_HOME%
If your SDK is in a different location correct the environment variable using the command:
setx ANDROID_SDK_HOME "C:\Android\sdk"
Now we know the SDK is pointing to the correct place at the command prompt navigate to the "sdk\platform-tools" directory and issue the commands
adb devices
adb kill-server
Notice in the image my device in the "unauthorized" state.
Now on the phone itself navigate to the developer options page and select "Revoke USB debugging authorization".
Now head back over to Android Studio and select "Run -> Run app" menu option.
Now, when you attempt to run your application your phone should pop up with the following dialog:
When you see this you should be home and dry. Now when you start adb it should be authorized.
Finally, if you are upgrading Android Studio from a beta make sure that your target SDK and minimum SDK are set correctly. Right-click on the app folder and select "Open Module Settings".
Hope this helps..

Where to run adb kill-server command for Intellij IDEA Android "USB Device not found" error

Whenever I try to connect my device in debugging mode for running test app in Intellij IDEA shows error "USB Device not found".
To solve this error some commands like "kill adb-server" need to be run.
But where should I run this commands?
Their is a icon for Android Device Monitor
Normally in your sdk folder you can find adb.exe
Just use the search box while in your sdk folder and find it. Then when you know the folder its in, hold ctrl and right click that folder, click open command prompt here. Then run your commands. if that doesnt fix it make sure you have the drivers for your device installed.

How do I view Log messages in Android?

I am trying to debug my android application using log messages. When I use System.out.println and Log.i and run the android application,I cannot see the debug message in either console or Logcat. If I have to get the debug messages do I have to run the android app in debug mode
from eclipse goto window -> open perspective -> other -> select DDMS.
And then run your app. And then select your running device from DDMS.
If it is not resolved your problem, restart your eclipse without closing your emulator and then flow the same above steps.
Njoy,
You do not need to run your app in debug mode to see log messages.
In order to see the log messages, you only need to have usb debugging enabled on your phone, the adb drivers for your device installed, and a copy of the android developer tools. It sounds like you have the above things, so I will suggest some steps for troubleshooting this.
Don't use System.out.println, because it does not allow you to specify a tag. Make sure that you set a good tag for your log messages. Once all of the above is confirmed, attempt to view the log message in eclipse's logcat view. Create a filter with the tag you are using because many messages will print and it may be difficult to find yours. You can also filter by application by using the name of your application's package.
If you have tried all this and you still can't see log messages, try running:
adb kill-server
and
adb start-server
If no luck, try restarting eclipse.
Confirm your device is plugged in!
If none of this is working, you can also run ddms from the sdk tools which is a bit more reliable.
Finally if that doesn't work, you can simply issue an adb logcat on the command line. If you have multiple devices, you can list them with adb devices and resolve the device or emulator with -d for the only connected device, -e for the emulator, or -s serialno to resolve otherwise.
There are also tools that will allow you to view the logs on your device, such as alogcat
sometime you may not select the emulator
and another way is to
restart your eclipse i also have faced this problem many times
If you're using Eclipse make sure that:
You have Debugging enabled in your device (or that you use emulator),
Your device is connected properly - it should show up in the Devices view. If you don't have this view get it from Window->Show View->Devices,
You've SELECTED your device in the Device View (simply click on it),
You don't have the LogCat paused and no filter is enabled - All messages (no filters).

Android Debugging with Logcat and Emulator. Is it possible?

This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.
Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
If you have setup nbandroid you can find the adb logcat viewer in netbeans under:
Window -> Output -> ADB Log
--edit
Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK.
At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.

Categories

Resources