[Q] Regarding Android Virtual Device (AVD) - Android Q&A, Help & Troubleshooting

Hi guys, i am currently creating a bash script which would record/log the actions done by an apk file after it is installed into a Android Virtual Device. However I have some queries regarding the logging portion which I hope I could clarify here:
1.) I read about a command known as logcat which outputs a log, however does logcat log every event from the starting up of the AVD till the logcat command ends? Or does it only record logs when the command is execute?
2.) Does the logcat's log record every single changes made to the AVD (including sending of messages, creation of files, phonecalls, accessing websites using the AVD's browser) ?
3.) Are there any alternative method to log the changes made to the AVD?
Thanks for any help in advance.

Well, yes
logcat displays everything, every change right from the very beginning of the booting of your device.
Alternative method to log, I don't know why you are looking for that, but I can't remember if I know anything about it

iamareebjamal said:
Well, yes
logcat displays everything, every change right from the very beginning of the booting of your device.
Alternative method to log, I don't know why you are looking for that, but I can't remember if I know anything about it
Click to expand...
Click to collapse
Hi iamareebjamal, thanks for the help :good:. I guess I will stick to using logcat. However I am wondering if I want to log all of the possible actions (e.g deletion of files, sending sms to other numbers, etc) taken by an application, do I have to run all of the activities listed by the aapt command or is it sufficient to just run one activity to log all of the possible changes made by the apk file.

dk3498 said:
Hi iamareebjamal, thanks for the help :good:. I guess I will stick to using logcat. However I am wondering if I want to log all of the possible actions (e.g deletion of files, sending sms to other numbers, etc) taken by an application, do I have to run all of the activities listed by the aapt command or is it sufficient to just run one activity to log all of the possible changes made by the apk file.
Click to expand...
Click to collapse
Not sure if I'm completely right but one main activity should be fine

iamareebjamal said:
Not sure if I'm completely right but one main activity should be fine
Click to expand...
Click to collapse
Hi, what do you mean by main activity? Because I noticed that the output from the command aapt produces a list of activities however I am not sure how to identify a main activity.

dk3498 said:
Hi, what do you mean by main activity? Because I noticed that the output from the command aapt produces a list of activities however I am not sure how to identify a main activity.
Click to expand...
Click to collapse
Write the activities here, I may be able to identify one

iamareebjamal said:
Write the activities here, I may be able to identify one
Click to expand...
Click to collapse
Hi iamareebjamal, one of my apk has the following activities:
.Splash
.ParkingSuffle
Are there any generic names given to the apks for the main activity?

dk3498 said:
Hi iamareebjamal, one of my apk has the following activities:
.Splash
.ParkingSuffle
Are there any generic names given to the apks for the main activity?
Click to expand...
Click to collapse
Sorry for the late reply
I would say to just take a logcat unspecifically and see if it helps
According to me, it will log any change in Android System irrespective of any app
So, give it a shot and then tell
Sent from my GT-S5830i using xda app-developers app

Related

can I tell why phone force closes ?

i have been experiencing some force closes and random restarted, is there a program that can tell me what caused it or what app caused the error.
Not really a simple way to troubleshoot that. Did you do a full wipe prior to flashing whatever ROM you're running? Trying booting into recovery and wiping dalvik/cache, that can fix plenty of small issues.
bluephi1914 said:
i have been experiencing some force closes and random restarted, is there a program that can tell me what caused it or what app caused the error.
Click to expand...
Click to collapse
yes, logcat will show you, but you have to kinda know what you're looking for. There are some logcat apps on the market or you can logcat through ADB.
Also, random app FCs aren't all that weird, BUT if you are getting them consistently you could very likely fix it by fixing permissions in recovery.
If you fix perms and the issues persist, feel free to pull a logcat of the app crash, and either PM me the .txt file or link it here via pastebin.com. I am no expert but I could try to help. But again, fix perms first, that'll probably work.
bluephi1914 said:
i have been experiencing some force closes and random restarted, is there a program that can tell me what caused it or what app caused the error.
Click to expand...
Click to collapse
Yes, there is a way but it requires a bit of technical knowledge. Assuming you have the motivation, acquiring the knowledge shouldn't be an issue.
If you're familiar with how to use ADB (Android Debug Bridge), this program allows you to access a log Android creates on the device where all applications output errors, debug, warning and verbose information.
From the command line, you'd run, adb logcat or adb shell logcat. If you prefer to have a bit of a GUI, run ddms which is also packaged inside the Android SDK.
There is an Android application called aLogCat for free in the Android Market which offers a GUI on the device for viewing this information. Feel free to also try this method and see which works best for you.
Essentially, this log will contain a lot of information. HTC coders seem to lean on the side of outputing a lot of information.
This log is real time, it will scroll as the applications output information. The best way to find the FC is to trigger the FC and immediately look in logcat for the details. They should be flagged by E, for error, followed by some type of name convention for the application. There will generally be anywhere from 5-15 lines of output in logcat when an application force closes.
Once you're able to locate the FC error output in logcat, feel free to post back up here and we can attempt to give some feedback.
Understand, sometimes the issue is the result of the application developer's poor coding or not being able to forsee a potential error. Other times, the solution is as simple as wiping dalvik-cache or wiping the application's settings causing it to start again from scratch.
Hope that helps! Good luck!
joeykrim said:
Yes, there is a way but it requires a bit of technical knowledge. Assuming you have the motivation, acquiring the knowledge shouldn't be an issue.
If you're familiar with how to use ADB (Android Debug Bridge), this program allows you to access a log Android creates on the device where all applications output errors, debug, warning and verbose information.
From the command line, you'd run, adb logcat or adb shell logcat. If you prefer to have a bit of a GUI, run ddms which is also packaged inside the Android SDK.
There is an Android application called aLogCat for free in the Android Market which offers a GUI on the device for viewing this information. Feel free to also try this method and see which works best for you.
Essentially, this log will contain a lot of information. HTC coders seem to lean on the side of outputing a lot of information.
This log is real time, it will scroll as the applications output information. The best way to find the FC is to trigger the FC and immediately look in logcat for the details. They should be flagged by E, for error, followed by some type of name convention for the application. There will generally be anywhere from 5-15 lines of output in logcat when an application force closes.
Once you're able to locate the FC error output in logcat, feel free to post back up here and we can attempt to give some feedback.
Understand, sometimes the issue is the result of the application developer's poor coding or not being able to forsee a potential error. Other times, the solution is as simple as wiping dalvik-cache or wiping the application's settings causing it to start again from scratch.
Hope that helps! Good luck!
Click to expand...
Click to collapse
YOU HAVE GOT TO BE KIDDING ME... LOL as soon as i typed "adb logcat" at the command prompt in windows, the screen immediately fills up... and like you said its real time so it doesn't stop.
When "ADB logcat" is typed how far does this log go back. I think i typed it about 5-10 minutes after the restart....or random hot reboot. was this to long ???
Most of the lines begin with D/ or I/ or or V/ didn't see any E .... but im currently scrolling back through all of the output in the CMD screen, i had to unplug the phone to get it to stop scrolling.
il Duce said:
yes, logcat will show you, but you have to kinda know what you're looking for. There are some logcat apps on the market or you can logcat through ADB.
Also, random app FCs aren't all that weird, BUT if you are getting them consistently you could very likely fix it by fixing permissions in recovery.
If you fix perms and the issues persist, feel free to pull a logcat of the app crash, and either PM me the .txt file or link it here via pastebin.com. I am no expert but I could try to help. But again, fix perms first, that'll probably work.
Click to expand...
Click to collapse
typing "ADB logcat" from the command prompt in windows doesn't give me a .txt file does it?
bluephi1914 said:
typing "ADB logcat" from the command prompt in windows doesn't give me a .txt file does it?
Click to expand...
Click to collapse
Try to use the Fix Permissions Opinion in the Rom Manager App! That May Help...
Here's a Screenshot...
PMGRANDS said:
Here's a Screenshot...
Click to expand...
Click to collapse
Ok.. downloaded ROM Manager and ran Fix Permissions. Hopefully that will fix any issues that I had.
bluephi1914 said:
YOU HAVE GOT TO BE KIDDING ME... LOL as soon as i typed "adb logcat" at the command prompt in windows, the screen immediately fills up... and like you said its real time so it doesn't stop.
When "ADB logcat" is typed how far does this log go back. I think i typed it about 5-10 minutes after the restart....or random hot reboot. was this to long ???
Most of the lines begin with D/ or I/ or or V/ didn't see any E .... but im currently scrolling back through all of the output in the CMD screen, i had to unplug the phone to get it to stop scrolling.
Click to expand...
Click to collapse
D is debug, I is Information, V is verbose and E is Error. All FC messages will start with E although, sometimes other logcat information will help make the FC easier to understand. I usually gather them all around a specific FC and narrow it down as I go.
I don't recall the buffer limit size to logcat, but it is generally best to grab the logcat as soon as the FC issue occurs, that way the issue will be closest to the end of the buffer. This makes it easier to locate and less likely to be pushed out of the buffer.
bluephi1914 said:
typing "ADB logcat" from the command prompt in windows doesn't give me a .txt file does it?
Click to expand...
Click to collapse
no, by default it updates the screen in real time, to have it dump to a text file, adb logcat > logcat.txt . you might need to hit cntrl+c to stop it as it will continue to write in real time to the log file until you exit. the exit command is cntrl + c to kill the process, same as exiting.
Hope that helps arm you with another skill!
edit: in the last month since i originally posted my first answer, i found an application on the market, which is essentially a GUI for logcat called aLogCat. the developer open sourced his code and the application started in 2009. seems to work very well.
source code: http://code.google.com/p/alogcat

[Q]

Hey everyone,
I'm a newb to android hacking (but fairly tech-savvy) but I was hoping someone could help me out with this. I'm running Bean's Revision 4 that I flashed with TWRP and everything is going swell except 1 small issue: I can't save any attachments that are sent to me via text message. I'm trying to save the photos of my niece and every time I do I get an error that says:
"/storage/sdcard0/DownloadIMG951035.jpg: open failed: EACCES (Permission Denied)"
I've searched quite a bit and found quite a few threads about permission issues and code that the people involved in the discussion claim can remedy the situation, but I don't know the first thing about how to run code on my Note 2. I've heard people mention running code in Terminal and I think I saw something about that in TWRP recovery, but can someone please help me out here. How do you run code on the Note 2? Does anyone happen to know what code I'd need to run to edit the permissions so I can save attachments from my text messaging app?
Thanks for any info!
P.S. Just realized I forgot a title for the thread... While we're in the helping spirit, anyone know how to edit a thread title AFTER posting?
You need to use a terminal emulator app, unless you have a recovery script. I prefer ConnectBot, but everyone has their own preference, I'm sure.
Make backups before you start running random code! What works for one person/phone/rom may not work for you.
Link. said:
You need to use a terminal emulator app, unless you have a recovery script. I prefer ConnectBot, but everyone has their own preference, I'm sure.
Make backups before you start running random code! What works for one person/phone/rom may not work for you.
Click to expand...
Click to collapse
OK, I actually found a terminal emulator app embedded in Bean's Revision 4 rom, but I don't suppose you (or anyone else for that matter) know what code I'd need to run in order to make this happen? I'd really like to have the ability to save attachments from text messages.

[Q] How get log from device? aLogcat not working on JB.

I have customer, who has crashing app on his phone.
Previously we use to use aLogcat application on the phone. So user was just instructed to extract log from this application and send logfile to us. But unfortunately aLogcat is not working since Jelly Bean update.
How can I get logcat info from his device without asking him to install entire Android SDK? Any simple software on the phone or on the Windows computer can do this trick?
R: [Q] How get log from device? aLogcat not working on JB.
You can get logcat with ADB.
xpirt
It's difficult if your customer's phone is rooted.. You are supporting your own application or you want to analyze the log of 3rd party apps?? There are some changes done for reading logs from 4.1 onwards.. now applications can read there own logs without any permissions.. but you need the root if you want to do the same for 3rd party app.. Read more here
amith007 said:
It's difficult if your customer's phone is rooted.. You are supporting your own application or you want to analyze the log of 3rd party apps?? There are some changes done for reading logs from 4.1 onwards.. now applications can read there own logs without any permissions.. but you need the root if you want to do the same for 3rd party app.. Read more here
Click to expand...
Click to collapse
Actually it is problem in my own application, but system shuts down it by some reason. I would like to see "full picture", not only log from my app.
Right now I am sending to user the adb.exe and couple of related dlls. The user instructed to connect cable, open cmd line, type "adb logcat" and... pray that USB driver is correctly found by system and log is printed into the cmd window. After that he have to select, copy paste and send file to me. To many manual steps and risk when driver for adb is not found makes support process very unfriendly.
xpirt said:
You can get logcat with ADB.
Click to expand...
Click to collapse
that's what I do, but it is very complicated for my regular users. To many steps to get log out of the phone in to text file, sometimes problems with finding adb usb drivers. Thanks anyway

Telnet Script

Hi guys, i'd appreciate some help here. I would like to create a shell script / telnet script that will automatically login to my router using username and password and then send a command. I'd be calling this script thru tasker or probably using sl4a if phyton, or just thru terminal emulator if shell script. Basically the steps will be:
1. Connect to host
2. Enter username
3. Enter password
4. Enter a command
5. Exit/Disconnect
Hopefully, the script will not utilize third party app like lazy geek (expect for android).
Right Now I can only connect to the host but the user name and password is not sent. I am just stuck at the Login prompt.
Appreciate the help. TIA
Seems no one is to help with this, but how about a little help on lazy geek app. Couldn't havr it working on my nexus 5. Any help?
Send/Expect
You can use Send/Expect, either as a standalone app, or as a Tasker plugin.
I am a new user here, and as such am not allowed to post links. But look in the play store for Send/Expect, and the description will lead you back to the website where there is further documentation and a trial version available.
amosnomor said:
You can use Send/Expect, either as a standalone app, or as a Tasker plugin.
I am a new user here, and as such am not allowed to post links. But look in the play store for Send/Expect, and the description will lead you back to the website where there is further documentation and a trial version available.
Click to expand...
Click to collapse
Thanks, i've tried it several times and I could not even run the sample script.
phangs23 said:
Thanks, i've tried it several times and I could not even run the sample script.
Click to expand...
Click to collapse
Hello.
What sample script? What sorts of problems? Which version of Send/Expect are you using?
David
amosnomor said:
Hello.
What sample script? What sorts of problems? Which version of Send/Expect are you using?
David
Click to expand...
Click to collapse
No, sorry got it wrong. I haven't tried Send/Expect yet, haven't got time to get a way to buy it in the playstore, paid app. I'm from the Philippines so online payments are not that widely used yet. There are ways just haven't been able to set it up.
Anyway, what I meant was the app Lazygeek, which is the expect version for android, unfortunately, I couldn't even run it's sample script. I might try Send/Expect in few days.
Sorry, thanks.
phangs23 said:
No, sorry got it wrong. I haven't tried Send/Expect yet, haven't got time to get a way to buy it in the playstore, paid app.
Click to expand...
Click to collapse
On the Send/Expect website is a a page with a fully functional free trial version.
https://sites.google.com/site/sendexpect/
I have been using python with pexpect for similar projects, which i can recommend.
Otherwise linux has a expect command which you can use and is also fairly easy to use.
As i'm not yet allowed to post links, i cannot link that for you. But u can find man-page/tutorials with a quick googe search
Are you planning of running this from android environment or a full os-env?

[Q][RESOLVED] Browser app settings and sync contacts

Hi ,
Yesterday, I installed ubuntu touch in my nexus 4 and decided to use it as my daily rom.
So, i tried to modify some settings. Everything is working well, however i have two problems.
The first one : I failed to synchronized contacts with syncevolutions. It's working but it synchronise only one or few contacs in my .csv file. As a solution i used google contacts sync. But if somebody have (or had) the same problem it can be interesting to share the solution with evryvody.
The second one : I tried to change the browser app settings, but it didn't work. I used these two websites to help me :
"bazaar.launchpad.net/~phablet-team/webbrowser-app/trunk/view/head:/README#L71" and
"lists.launchpad.net/ubuntu-phone/msg10301.html" I removed the first part, because i'm not able to post outside links.
According to the first website, we can change the homepage and the searche engine, you can use the second website to understand how to do it, i followed the instructions, but it didn't work for me. So, if somebody want to try or already have the solution, it would be amazing.
Thanks.
Edit : Apparently It is now possible to change the search engine directly in the browser (18 June update)
Although it's about calendar sync, this might be helpful: http://forum.xda-developers.com/ubuntu-touch/help/calendar-app-doesnt-sync-t3054933
What's the content of your browser settings files? I have that working fine for me here.
Code:
[email protected]:~$ cat ~/.config/webbrowser-app/settings.conf
homepage=https://duckduckgo.com
searchengine=duck
allowOpenInBackgroundTab=true
[email protected]:~$ cat ~/.local/share/webbrowser-app/searchengines/duck.xml
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Duck Search</ShortName>
<Description>Search Duck Duck Go</Description>
<Url type="text/html"
template="https://duckduckgo.com/?q={searchTerms}"/>
<AdultContent>false</AdultContent>
<Language>en-au</Language>
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
thank you for your answer,
so i only had some problems in my duck.xml files, and it is working now.:good:
Thanks for everything, it might help other people too.
PS: i don't know have to change the title to [SOLVED]
Great to hear that. I'm glad that it's working now.
If you're using the web interface, you can click on the edit button below the first post, then on "Go Advanced" and then you can edit the title.
Sent from my awesome Ubuntu Touch device using the Forum Browser app
directory not found
Hello:
I can't find the directory: /home/phablet/.config/webbrowser-app /
on my bq aquaris 4.5 device...
When I try:
cat~/.config/webbrowser-app/settings.conf
the answer is:
No such file or directory
Thanks in advance.
natxuno said:
Hello:
I can't find the directory: /home/phablet/.config/webbrowser-app /
on my bq aquaris 4.5 device...
When I try:
cat~/.config/webbrowser-app/settings.conf
the answer is:
No such file or directory
Thanks in advance.
Click to expand...
Click to collapse
The file and directory isn't created by default. You have to create it manually.
Btw, a settings UI is coming soon.
Thx
nikwen said:
The file and directory isn't created by default. You have to create it manually.
Ok, I thought I only had to modify an existent file
I'll try...
Thanks a lot for your answer, nikwen.
Click to expand...
Click to collapse
natxuno said:
The file and directory isn't created by default. You have to create it manually.
Ok, I thought I only had to modify an existent file
I'll try...
Thanks a lot for your answer, nikwen.
Click to expand...
Click to collapse
The file is automatically generated on devel-proposed build 166 now. However, it's called webbrowser-app.conf there.
If you're on the stable channel, expect that your browser settings will break in the future. However, you'll simply have to apply your changes to the new file then.
Hello,
I decided to install ubuntu touch again after all the new things they made.
However, changing the browser is no more working for.
I just wanted to know if there was another way to do it or if it was only my fault ?
Moreover, is that possible to uninstall preinstalled scopes like 7digital, amazon, ebay ... ?
@Remy.L There is just one browser for Ubuntu (except one third party browser). You can switch tabs by swiping up from the bottom edge though.
No, uninstalling preinstalled scopes isn't possible using the GUI as long as they aren't in the store.
Sent from my awesome Ubuntu Touch device using the Forum Browser app
---------- Post added at 12:07 AM ---------- Previous post was at 12:04 AM ----------
Now I get what you mean with "changing the browser". There should be a settings option in the browser itself now (install the update from this week if you haven't already). Give it a try.
If there is still something you want to change manually, check out the contents of the browser's data directory. I think they renamed the settings file.
Sent from my awesome Ubuntu Touch device using the Forum Browser app
Sorry, i did not mean browser but search engine (replace google by duckduckgo).
I did not managed to have it working in the new version.
Anyway, do not bother you, i'm not using ubuntu touch anymore because i'm do not like that path they are taking with this OS (you can not uninstall what you do not want).
As i prefer to use open source software, the best thing to do now is to use an AOSP rom (or maybe firefox OS)
Thanks a lot for all your answers and have a nice day
PS: Sorry for my English, i'm not totally fluent
Edit : Apparently with the new version it is possible to change and chose the search engine you want.:good:
However, I guess that it is still impossible to remove unwanted stock scopes (however, as it is possible to remove unwanted stock apps, it may be possible to do it soon)
Remy.L said:
Sorry, i did not mean browser but search engine (replace google by duckduckgo).
I did not managed to have it working in the new version.
Anyway, do not bother you, i'm not using ubuntu touch anymore because i'm do not like that path they are taking with this OS (you can not uninstall what you do not want).
As i prefer to use open source software, the best thing to do now is to use an AOSP rom (or maybe firefox OS)
Thanks a lot for all your answers and have a nice day
PS: Sorry for my English, i'm not totally fluent
Edit : Apparently with the new version it is possible to change and chose the search engine you want.:good:
However, I guess that it is still impossible to remove unwanted stock scopes (however, as it is possible to remove unwanted stock apps, it may be possible to do it soon)
Click to expand...
Click to collapse
You could try removing them with the terminal-app like this:
Code:
sudo click unregister --user=phablet com.ubuntu.badscope
That should actually work. Pretty much everything can be uninstalled, even though not easily.
nikwen said:
You could try removing them with the terminal-app like this:
Code:
sudo click unregister --user=phablet com.ubuntu.badscope
That should actually work. Pretty much everything can be uninstalled, even though not easily.
Click to expand...
Click to collapse
Ok tried to use this command, however if i want to uninstall amazon scope, it says to me that com.ubuntu.amazon does not exist.
Moreover it seems that we still cannot change the search engine directly in the browser ( I tried the devel/ubuntu version via Multirom)
Remy
Remy.L said:
Ok tried to use this command, however if i want to uninstall amazon scope, it says to me that com.ubuntu.amazon does not exist.
Moreover it seems that we still cannot change the search engine directly in the browser ( I tried the devel/ubuntu version via Multirom)
Remy
Click to expand...
Click to collapse
You need to find out the right package name of the amazon scope (given that it is installed as a click package, of course; I was unable to find it using "click list").
The reason why you don't see the option to change the search engine is that the devel builds are really, really outdated. I think they are half a year old or something like that. Either install the stable channel or devel-proposed.
Ok, thank you for all your answers, it may help a lot of people
Unfortunatly I broker my Nexus 4 screen last week (I'm planning to repair it but not yet [in few month]) so i can not try this rom right now.
Once more, thanks again for your help and for your answers,
Have a nice day
Oh, I'm sorry to hear that. Did you know that the Meizu MX4 Ubuntu Edition has just been released?
Sent from my awesome Ubuntu Touch device using the Forum Browser app
Hi nikwen,
I'm back on this forum because i repaired my nexus 4. Everything is now workinh, and the rom seems very nice.
However it is still impossible to uninstall unwanted scopes (like amazon) even with the terminal. (impossible to know the name of the scope).
I also tried this sudo dpkg --get-selections >liste but it does not list the scopes name.
Thank you for all your answers
Remy.L said:
Hi nikwen,
I'm back on this forum because i repaired my nexus 4. Everything is now workinh, and the rom seems very nice.
However it is still impossible to uninstall unwanted scopes (like amazon) even with the terminal. (impossible to know the name of the scope).
I also tried this sudo dpkg --get-selections >liste but it does not list the scopes name.
Thank you for all your answers
Click to expand...
Click to collapse
Hi,
Yes, there's been a discussion about this on the ubuntu-phone mailing list recently. The reason why they can indeed not be uninstalled is that they are remote scopes with the code lying on a Canonical server and not on the device itself. I didn't follow the whole discussion, so if you are interested, check out the mailing list archive and you should be able to find the conversation within the first 5 pages.
Hi Nikwen,
So i checked your link and found what i needed
So yes, it is impossible to uninstall these scopes like you said, the only way is to keep it without using it.
But the thing i was thinking about is : If you do not use these scopes does it still get informations from you (in background) ? (because and do not want it to use my data continuously)
Sorry for all these questions
Have a nice day,
Remy
@Remy.L No, they won't be giving any information away. Scopes only run when they are in the foreground and even if they are, they are confined by a software called "apparmor", which means that they cannot access any data besides that which you enter into the search box. They don't have access to any of your private stuff.
Sent from my awesome Ubuntu Touch device using the Forum Browser app

Categories

Resources