Whenever I run my app from within Android Studio, the ADB output is automatically shown in a tool window e.g.:
Waiting for device.
Target device: asus-nexus_7
Uploading file
local path: C:\Development\AndroidStudioProjects\example\main\build\apk\main-debug-unaligned.apk
remote path: /data/local/tmp/com.example.app
Installing com.example.app
I almost never need to actually read this output, but I can't find a way to prevent it from showing. If I edit the run configuration, I can prevent logcat from opening automatically, but not the ADB output.
Is this possible?
Thanks
So, the logcat one can be solved by editing your run configurations.
From Run > Edit Configurations, select your Android run configuration from the menu on the left, and switch to the logcat tab. Uncheck the "Show logcat automatically" box and hit apply.
Then you'll have to deal with the issue of hiding the "Run" tool window, of which the only workaround I know is to resize it until it's not visible.
Related
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
I am using Android Studio v1.3.1 and when I am running a project on real device, I have to wait couple minutes till actual logs comes up in log console using Verbose & Show only selected application. If I choose No filtres it shows me older logs coming up, like 2-5 mins again. After all old logs are showed in console, it comes the news ones... I tried to restart logs, but it begins again to show old and then actual.
Any suggestions?
This issue(port issue) sometime happens if logcat does not clear the recent output caches on plugged devices.
AndroidStudio Solution (Clear all outputs and device ports)
Plug-Out your devices or close any emulators
File > Invalidate Caches / Restart > Press "Just Restart"
Also it's recommended to run any project with fully cleared logcat.
Run > Edit Configurations > Tab(Logcat) > CheckBox(Clear log before launch)
I personally would always log through terminal.
Terminal Solution
Just check if your device is plugged
path/to/android_sdk/platform-tools/./adb devices
Log your devices
path/to/android_sdk/platform-tools/./adb logcat
To get all logcat terminal options, see link below:
http://developer.android.com/tools/help/logcat.html
The entire log file is stored into the device storage, it can be extracted to the system so you can see the previous logs from the file.
Connect your device and run the command in terminal.
adb logcat -d > logcat.txt
I started to write android app with eclipse IDE. But when I run the app I am taking emulator-5554 disconnected! Cancelling 'com.example.merhaba.Main activity launch'! error. What can I do?
The problem as I discovered lays in the fact the the project has no appropriate Virtual Device defined for it in the AVD manager.
So the recommended steps in eclipse are:
Go to "Project"-> Properties-> Android.
On the right pane see what line is checked in the Project build target.
Remember the target platform number that appears in the selected line.
Go to "Windows"-> AVD Manager.
Check the list of existing Android Virtual Devices for a device that matches the Platform and API level that you have set for your project (see step #2 above).
If there is no line that includes an AVD for your platform (as I suspect), add it using the "New" button.
A "Create New Android Virtual Device" window will be opened. set a new device name. in the "Target" selection box choose the right platform for your project.
--- OR ---
Open Android Virtual Device Manager
select the AVD you use for your app.
Press the start button and wait for a new form to show up called (Launch Options).
Check the box "Wipe user data" and hit "Launch" button.
This should work.
--- OR ---
Open Android Virtual Device Manager
Delete the AVD you use for your app.
Create an new AVD.
Start you new AVD.
This should also work.
-- OR --
try this..
go to DDMS perspective-->select Device-->go to Window-->Navigation-->Show view menu-->reset adb.. .
Enjoy your emulator once again!
This solved it for me:
1) Leave Eclipse open and the emulator also open even though Eclipse doesn't find it.
2) In command line type:
adb kill-server
Then when prompt comes back, type
adb start-server
3) After adb starts again, try to run your project again from Eclipse.
You can kill ADB from the Window Task manager but I advice you kill the ADB process tree. By right clicking on the adb on the Task manager and then click on END Process TREE. That worked for me and I believe it will help you to solve the problem. But make sure you have your AVD recognised. To do this click window--AVD Manager--click on the AVD you want to use to highlight it, then click on the START tab--The launch options opens up. Click on Wipe user data and then click on LAUNCH. That will help you launch your identified AVD before you go ahead to kill Adb process tree as I described earlier. That did the magic for me. After doing this try running the program. If you get an error like "Activity not working", don't panic. It's not an error but it's just there to tell you that you are running your program again without any change or update on the code. You can just click the backward button on your emulator and then run again and you won't see that error again.
Go to run-> configuration->Target->select Avd -> Run it. It solved my problem which made me crazy
just restart your eclipse and run it again
Go to the Device view and on the upper right corner there is a down arrow, click there an later on reset adb..after a few seconds try to re-run the app,it should work.
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).
I have read that in order to clear data stored in the Android emulator I should start the emulator with the "-wipe-data" arguments. However, I can't see how to specify startup arguments. I have read that it should be possible to specify these in the "Target" tab of the Debug Configurations dialog. However, if I open Debug Configurations from the Eclipse Run menu all I see in the Target tab are radio buttons for "Manual" or "Automatic" Deployment Target Selection Mode, buttons for "Refresh" and "Manager..." and drop-down boxes for "Network Speed" and "Network Latency" options. There are buttons for "Details..." and "Start..." but these are grey. I can't see anywhere where I can enter a "-wipe-data" option. The Run Configurations dialog seems to be identical. (I am using Eclipse SDK 3.5.2)
Since asking this question I have found out how to use the "ADB Shell" to wipe the data, and have found that the "Shell" is not as intimidating as it sounds.
For the benefit of any Windows user reading this who is not sure about using the Shell, this is what I did:
as a prerequisite I ensured that I had followed the instructions in the Android SDK documentation (http://developer.android.com/sdk/installing.html) on including the "SDK Tools" folder in my Windows "Path" variable ... this avoids having to type in the full path name to the Tools folder whenever using one of the tools
from the Windows Start menu I selected "Run" and typed in "cmd" (without the quotes) to open a Windows Command window
after the Windows Command Prompt ">" I typed "adb shell" (without the quotes) and hit the return key, which popped up an ADB prompt in the Command Window, which looks like "# ". (Note: in order for this to work it seems to be necessary to have the Android emulator running; if not, "error: device not found" is reported.)
at the ADB prompt (i.e. after "# ") I typed as a single line rm data/data/[package name, e.g. com.aaa.bbb]/databases/[Database name] and hit the return key
this wiped the data from my app within the emulator, as I was able to confirm by looking in the File Explorer in the DDMS window and confirming that my package no longer appeared under the data/data folder.
Having said all this, it would obviously be preferable if I could amend the Run Configuration so that the data is automatically wiped every time the app is run in the emulator, so if anyone knows the answer to my original question I should be very pleased to hear it!