Sending calls to running GUI apps via CLI - G1 Android Development

This is /sort/ of a development question; if the mods feel it's more properly in Q&A, please move it.
First off, a little disclosure; "IANAP".
Okay, here goes:
Currently I am trying to create what ought to be a /very/ simple script using "am" (as in; am start -a blahblah -n blahblah/.blah ) in order to invoke an activity for a specific application. Unfortunately, apparently the activity can only be called viably from //within// the application.
The app in question is "redditisfun" ( http://github.com/talklittle/reddit-is-fun ). The activity in question is ".InboxActivity". So far, I can get the first bit of code to pull up the app, but the second bit fails out due to lack of permission.
1)
Code:
am start -a android.intent.activity.MAIN -n com.andrewshu.android.redditdonation/.RedditIsFun
2)
Code:
am start -a android.intent.activity.MAIN -n com.andrewshu.android.redditdonation/.InboxActivity
I've tried it with "broadcast" rather than "start" -- that throws no errors, but simply does nothing. (logcat shows no activity that I can see.)
So here's my question; how does one send a system call to an app that is already running, using am? I am afraid that none of the documentation I've yet found says anything at all about this.

Related

Learn to logcat like a Pro!

adb logcat bootcamp
I'm going to be teaching the basics of logcats. I sat for a few hours a while back and hammered all this stuff out with ckisgen from XDA/ACS holding my hand the whole way, so this is good info here. I see lots of posts about issues people have and no logcats accompanying them. A good logcat is fried gold to a dev troubleshooting a problem. I did the whole thing in Ubuntu (Linux) and have listed the Window$ $pecific desktop pathing below the Linux command. UNIVERSAL COMMANDS LINUX COMMANDS WINDOWS COMMANDS.
When I say Terminal, I mean Command Prompt for you Window$ u$er$ (start-run-cmd)
In terminal with your phone plugged into the computer
A Logcat:
Code:
[COLOR=#ff0000][FONT=Arial][SIZE=3]adb logcat[/SIZE][/FONT][/COLOR]
This doesn't START logcat, this tells terminal to grab the information already on the device logcat and display it in terminal. This isn't so useful to us. It just scrolls the information in terminal and you can read it there. This is kinda difficult to read though, for one it's constantly scrolling as your phone does things and two, it's likely that your terminal is configured to only allow a certain number of lines to be kept readable before they drop off.
Pipe it to Desktop as a .txt file
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat > ~/Desktop/logcat.txt [/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
This command above will tell the logcat to export the terminal logcat to a .txt file on your desktop called logcat.txt The '>' symbol tells the logcat to pipe to the location listed. This will continue to update even if you open the text file, so long as you have terminal running. It's not done “live” though, you have to either refresh the file, or close it then re-open it. That won't affect anything other than giving you an update. Now we're getting somewhere, but where?
Code:
[COLOR=#ff0000][FONT=Arial][SIZE=3]adb logcat > /sdcard/logcat.txt[/SIZE][/FONT][/COLOR]
If using Terminal Emulator on your phone instead of a computer setup, this (above) is the code you'd want to use. It will save the logcat.txt to the root of your SD card. Next!
-v long, or not to -v long, that is the question!
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Now we're telling the logcat to do something more interesting. We are telling it to give us every scrap of information it has. This will space the logcat out nice and pretty and really make things easier to read as well, even giving time stamps of when everything happened! Now you can say “it happened at about 9:30 pm” and we can find that. Winning!
Sometimes you want to filter down the information though. You want to make the dev's life easier. Here is how:
First, a brief on Tags and Priorities.
Tags are going to be what process is actually giving the information, for example 'ActivityManager', 'Database', and 'WindowsManager' are all Tags you can find. There are TONS of these suckers! Research into what your problem is and try to pick out the tag.
Priorities are different. These will tell you how serious the issue at hand is. The priorities are called by their letter code and are:
V Verbose
D Debug
I Info
W Warning
E Error
F Fatal
S Silent (suppress all output)
These are in ascending order. In other words, Verbose or V is going to be the micro information which doesn't really mean much to anyone 99.99% of the time where as Fatal or F is going to be a huge catastrophic issue. When filtering for a Priority it will include the Priority you give PLUS all HIGHER Priorities. So, for example, if you call to filter for Warning or W then it will give you Warning, Error, and Fatal. That is common to filter for. Below are some examples of code:
( PS - you would never actually type or input ‘{‘ or ‘}’ in your logcat commands .. they are in some of the examples below to show you that these are generic modifiers … meaning - if you were actually inputting the command you would replace the {Tag} with an actual Tag, like: ActivityManager or GTalkService .. in the same way you would replace {Priority} with an actual Priority, such as: W or E )
Examples
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat {Tag}:{Priority} *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat {Tag}:{Priority} *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you know exactly what Tag (GTalkService or ActivityManager) and Priority (W or E) you are looking for.
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat *:{Priority} *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat *:{Priority} *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you don't know the Tag, but know the Priority. The * is a wild card that basically means all/any. An example of a VERY valuable logcat could be:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat *:W *:S > ~/Desktop/logcatALLwarnings.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat *:W *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
So, the command above would give you all tags that had a priority of Warning, Error, or Fatal. It would silence (not show) everything else and would pipe the output of your log to your desktop as a text file named logcatALLwarnings.txt … moving along …
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat {Tag}:V *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat {Tag}:V *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
The above line is if you know the Tag but want to see all Priorities. {Tag}:V outputs all priorities for the specific Tag you’ve entered because it calls for the V (Verbose) priority, which is the very lowest priority … and as you recall, it always gives you the priority you’ve asked for AND above.
The *:S tells the logcat to Silence (or ignore) all lines/messages that have not otherwise been specifically called for using these filter expressions. This CAN cause issues though, sometimes it will silence what you're looking for / everything.
A final specific example from my phone to be clear. I got a Database Tag with an Info Priority, if I wanted to see all instances of this happening, I could use the following code:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat Database:I *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat Database:I *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Or, if I had an ActivityManager Warning I could use
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat ActivityManager:W *:S > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat ActivityManager:W *:S > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
Ok, now we're going to the show! You know the tools, but how do I use them? Glad you asked!
For the first time you boot a ROM/Kernel bundled together (IE InsomMIUI 1.12.2) or for just a kernel you're going to do the following:
Once you're finished full wiping and installing the ROM, but haven't rebooted the phone yet. (Or wiping just the caches for a separate Kernel):
Open Terminal on your computer
enter the following code
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/logcat.txt[/SIZE][/FONT][/COLOR][COLOR=#0000ff]
[/COLOR][COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\logcat.txt[/SIZE][/FONT][/COLOR]
​
Name the logcat something useful. A good format is to use you're initials, rom name, what it is, and date. This way it stands out. So the code with the really long but helpful file name would be:
Code:
[COLOR=#008000][FONT=Arial][SIZE=3]adb logcat -v long > ~/Desktop/JH_InsomMIUI1122_firstboot_5Dect11.txt[/SIZE][/FONT][/COLOR]
[COLOR=#0000ff][FONT=Arial][SIZE=3]adb logcat -v long > %userprofile%\desktop\JH_InsomMIUI1122_firstboot_5Dect11.txt[/SIZE][/FONT][/COLOR]
Yes, I know that's a long name, but we look at dozens of these things, it helps!
In recovery tell it to reboot the phone. The logcat will start recording internally on your device at boot automatically.
Once the phone is at the lockscreen let it sit for 5 minutes.
Unlock the phone and let it sit for about 10 seconds.
Restart the phone.
Once you restart the phone open the logcat file on your desktop to make sure it’s not blank/empty/something went wrong and if everything’s golden - send to your favorite developer (ME! ).
FYI , the -v option sets the output format. -v long after the logcat command formats the log so that it adds a date and time stamp to each line. It also separates each line with a blank line .. making the log as a whole much easier to look through.
That's it, you should be off to the races with these logcats. I hope this has helped!
Wow this is great I hope People make use of this.
Glad you like it
this has been a message from the dead pool.
Im still very much a noob and dont like posting unless necessary but would like to help when I can. Is there a way to do this on a mac?
It should be really similar to linux. You'll have to have the sdk installed and running which I don't know how to do on mac but the commands should be similar. Let me look into it.
this has been a message from the dead pool.
hy,
Realy nice tutorial.
Can you make a tutorial to how to use logcat from terminal emulator from phone?
Nice info. thanks
Good post m8
One minor criticism, not just of this post but many "How to's" on this forum.
A clear description of what a logcat is and how it maybe useful would go a long way to help educate the inexperienced.
I only say this as i have non techy friends who constantly complain about this issue.
They go looking for info to sort their own issues out and are confronted with jargon on jargon on jargon ..... with no 'Plain English explanation"
We should all try to remember not everyone possesses the same tech knowledge, and we all where N00bs once we only ascended to being the godlike superusers we are due to others making knowledge clearly available to us.
Th idea that "if you don't understand then this isn't for you" is pretty narrow and arrogant.
When I run logcat on my phone, using the command
Code:
adb logcat -v long > /sdcard/logcat.txt
the next line display is
Code:
- waiting for device -
and then does nothing. What am I doing wrong?
Adb doesn't see your devices. Do you have debugging turned on in settings? If you do try:
Code:
adb devices
If you don't see anything you don't have debugging turned on or you don't have the drivers installed for your devices. Or it isn't plugged in.
PrinceFX said:
When I run logcat on my phone, using the command
Code:
adb logcat -v long > /sdcard/logcat.txt
the next line display is
Code:
- waiting for device -
and then does nothing. What am I doing wrong?
Click to expand...
Click to collapse
Seems I need to fix it. For doing this on the phone you should enter 'su' to gain superuser than type "logcat..." and whatever. It reads logcat directly, not through adb. Sorry about missing your reply earlier. Hope this helps.
Sent from my HTC Glacier using Tapatalk 2
Nice write up Thanks .
Thanks
This is a really nice post...
XDA is gr8...
greg
Thanks for the article. I also like using the '-t' switch to grab the last n log entries (e.g., 'adb logcat -t 100 -v time'). Also, if you need a bit more compact log output, using the 'time' format works nicely.
This is a great article. I have learnt a lot. Could you take time to add a description about the various switches like -f, or -t etc that can be used with logcat. It's really very difficult for me to understand those switches...plzz Will be really helpful for others as well.
The-Droidster said:
This is a great article. I have learnt a lot. Could you take time to add a description about the various switches like -f, or -t etc that can be used with logcat. It's really very difficult for me to understand those switches...plzz Will be really helpful for others as well.
Click to expand...
Click to collapse
Code:
[email protected]:/ $ logcat --help
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent.
Like specifying filterspec '*:s'
-f <filename> Log to file. Default to stdout
-r [<kbytes>] Rotate log every kbytes. (16 if unspecified). Requires -f
-n <count> Sets max number of rotated logs to <count>, default 4
-v <format> Sets the log print format, where <format> is one of:
brief process tag thread raw time threadtime long
-c clear (flush) the entire log and exit
-d dump the log and then exit (don't block)
-t <count> print only the most recent <count> lines (implies -d)
-g get the size of the log's ring buffer and exit
-b <buffer> Request alternate ring buffer, 'main', 'system', 'radio'
or 'events'. Multiple -b parameters are allowed and the
results are interleaved. The default is -b main -b system.
-B output the log in binary
-C colored output
filterspecs are a series of
<tag>[:priority]
where <tag> is a log component tag (or * for all) and priority is:
V Verbose
D Debug
I Info
W Warn
E Error
F Fatal
S Silent (supress all output)
'*' means '*:d' and <tag> by itself means <tag>:v
If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS.
If no filterspec is found, filter defaults to '*:I'
If not specified with -v, format is set from ANDROID_PRINTF_LOG
or defaults to "brief"
The help output is pretty clear. '-f' allows you to save log in file. '-t' specifies how many lines for logcat to print (counting backward from present).
example:
logcat -v time -t 100 -f /sdcard/logtest1.txt
This prints last 100 lines in 'time' format to file logtest1.txt
Play with it and have fun.
Good stuff in here, going to logcat some JB roms now!
Thanx......That was really informative.
lanternslight456 said:
Seems I need to fix it. For doing this on the phone you should enter 'su' to gain superuser than type "logcat..." and whatever. It reads logcat directly, not through adb. Sorry about missing your reply earlier. Hope this helps.
Sent from my HTC Glacier using Tapatalk 2
Click to expand...
Click to collapse
Same thing happens to me
I've have checked my settings, and I can't see anything "wrong"
I've also tried different apps, like alogcat but they don't show anything either.
I don't have to 'su' on SGS2/I777 with CM9 ROM. Works for me from ADB or in phone shell.
It probably depends on the ROM you are running and permissions set.

[Resolved] [Q] Finding the right activity?

I installed the MotoBlur style Atrix Clock HD skin for the EZ Weather app. It works pretty great, except the actual weather application sucks. So using tasker, i intercept the app being opened and i force it closed and then open an app of my choice. Peachy.
Well, all the other apps suck too. The one i like the most is the overlay that comes with HD Widgets.
That said, I'd like to make it so that the HD Widgets' overlay comes up instead of the default app. As you read above, I already know how to do this. The problem is that i can't find the right "activity" (don't know if this is the proper jargon) to launch when i want to do this override. I made a video which shows that i can't find the "activity" that i want. I can select them, but these are all just configuration activities and not the weather activity.
Knowing that a press on the widget produces the weather app, but also knowing that none of the activities reflect that particular desirable screen are showing up when i search them, how can i find the correct activity so that i can point to it using tasker? Or is it something else i should be doing?
no way!! no one knows this stuff???
Angry Black Man said:
no way!! no one knows this stuff???
Click to expand...
Click to collapse
You want to find the activity of the app coming on ? What is the weather activity you're looking for ? you don't know the name , what does it do ?
The main activity is what's used when the app first opens
It's all there in the video and my description. Keep in mind, I don't know what I'm trying to do which is why I'm asking the question. Carefully read my post and it describes exactly what I'm trying to do and my video shows the impediment to that.
I don't know what it is. The things I see are.
Package ,
cloudytv.hdwidgets
Activity ,
cloudtv.hdwidgets.activities.MainActivity
Component ,
ComponentInfo{cloudtv.hdwidgets/cloudtv.hdwidgets.activities.MainActivity}
@Angry Black Man,
I know precisely what you're asking for, and it's actually surprisingly difficult. Here's the best and most convenient method I've come across for finding the names of the activities in packages.
1. Download and install (even if temporarily) this version of ADW Launcher.
2. Follow this sequence of taps: Menu > Add > Custom shortcut > Pick your activity > Activities.
3. You are now on a screen with a list of all the apps you have installed on your device. This includes in /data/app and /system/app.
4. Find the app that you need the activity name for and tap on its small downward-pointing arrow on the far left side.
5. This opens a list of all of the activities available for the app. Using the labels and your logical reasoning, find out which activity is the one you need.
6a. From here, you have two choices. Choice 6a. (this one) is to tap on that activity, tap "OK", and make a shortcut on your homescreen directly to the activity. Or...
6b. Choice 6b. is to memorize/write down the activity you want to execute in the terminal (remember the period "."), exit the Custom shortcut dialog, open up the terminal and execute this:
Code:
su
am start -n [package name found in /data/app or /system/app]/[activity name you memorized/wrote down]
For example, to execute the activity to start Developer Options, I would use this:
Code:
su
am start -n com.android.settings/.DevelopmentSettings
Hope this helps!
Thank God. Someone with some actual technical understanding! Well, I dove in, but I just couldn't crack this egg. I did see more activities than I was able to get to in my video, but in adw, I keep getting " app not installed" errors. I then installed secure settings for tasker and got to the activities and was able to get one of my Samsung weather activities to work, but I simply can't find the hd widgets activity. I tried weirdly named activities within hd widgets that works crash immediately.. Are there " hidden" activities?
Angry Black Man said:
Thank goodness. Someone with some actual technical understanding! Well, I dove in, but I just couldn't crack this egg. I did see more activities than I was able to get to in my video, but in adw, I keep getting " app not installed" errors. I then installed secure settings for tasker and got to the activities and was able to get one of my Samsung weather activities to work, but I simply can't find the hd widgets activity. I tried weirdly named activities within hd widgets that works crash immediately.. Are there " hidden" activities?
Click to expand...
Click to collapse
No, there aren't - ADW without a doubt provides the full list. However, many activities are dependent upon other ones. They just f/c if you start them individually, but if used in conjunction with other activities, they work properly.
Only problem with that is that the only real way to launch multiple activities at the same time is to launch the entire package (app). This is even harder with widgets, however, because of how they work differently than regular apps. That's why you're getting the "App not installed on your phone" error - because the Android system gets finicky when it tries to launch a widget activity.
I figured out a solution!!!!!
WHEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Got it
Okay, so understanding that I had the right "jargon" (the word "activity") i focused my search on this type of word. I even went to far as to ask the developers directly how to trigger the intent:
[email protected] said:
Hi Aaron,
I believe this is tied to an action (my apologies as I don't know the exact code terminology) - the weather app will launch only when you tap on your weather hotspot. Opening the app from the icon will only open the editor. To link this in another app, you'll need to replicate the action of tapping on the hotspot in order to link directly to weather.
Thanks,
Sol
Click to expand...
Click to collapse
...which didn't tell me anything I didn't already know. Useless.
So i keep plugging along. I installed "Secure Settings" which as I mentioned exposed "more" activities in apps, but led to my question of finding "hidden" activities (one's that i simply couldn't find in a menu someplace). Every time i searched "activity logger" on google, i kept finding stuff about keyloggers and *actual* activity loggers. ARGH!
I decided then to search for "adb activity logger" to try and make the search very specific to app design. I ended up at this stackexchange discussion titled "View the Task's activity stack". The accepted solution (God bless stack exchange for not polluting the internet with useless, non-peer reviewed information) suggested using adb to dump all the activities on the device. Further (thank you stackexchange solution comments!!!!!) someone suggested grepping only the information i needed.
On windows, the grep equivalent is "find", so i just made the necessary modifications to the command:
Code:
adb shell dumpsys activity | find /i "cloudtv"
which shat out:
Code:
* PendingIntentRecord{4368c4e0 cloudtv.hdwidgets broadcastIntent}
* PendingIntentRecord{436dfdf8 cloudtv.hdwidgets broadcastIntent}
* PendingIntentRecord{4477ecb0 cloudtv.hdwidgets startActivity}
#19: BroadcastRecord{43cd02a8 u0 cloudtv.UPDATE_TIME}
act=cloudtv.UPDATE_TIME flg=0x10
#19: act=cloudtv.UPDATE_TIME flg=0x10
-> 15158:cloudtv.hdwidgets/u0a259 s1/1 u0/0 +5h16m5s671ms
* ServiceRecord{440b7d68 u0 cloudtv.hdwidgets/.services.WidgetUpdaterService}
app=ProcessRecord{430c05b0 15158:cloudtv.hdwidgets/u0a259}
* Recent #4: TaskRecord{45de8b40 #90 A=cloudtv.hdwidgets U=0 sz=0}
Proc #14: cch+4 B/ /S trm: 0 15158:cloudtv.hdwidgets/u0a259 (cch-started-ui
-services)
C:\Users\User>adb shell dumpsys activity | find /i "cloudtv"
* PendingIntentRecord{4368c4e0 cloudtv.hdwidgets broadcastIntent}
* PendingIntentRecord{436dfdf8 cloudtv.hdwidgets broadcastIntent}
* PendingIntentRecord{4477ecb0 cloudtv.hdwidgets startActivity}
#3: BroadcastRecord{45f650f8 u0 cloudtv.hdwidgets.WEATHER_UPDATED}
act=cloudtv.hdwidgets.WEATHER_UPDATED flg=0x10 (has extras)
#4: BroadcastRecord{45f65008 u0 cloudtv.hdwidgets.WEATHER_UPDATED}
act=cloudtv.hdwidgets.WEATHER_UPDATED flg=0x10 (has extras)
extras: Bundle[{activityState=create, activityPackageName=cloudtv.hdwidgets}
]
#43: BroadcastRecord{43cd02a8 u0 cloudtv.UPDATE_TIME}
act=cloudtv.UPDATE_TIME flg=0x10
#43: act=cloudtv.UPDATE_TIME flg=0x10
-> 15158:cloudtv.hdwidgets/u0a259 s1/1 u0/0 +5h16m28s216ms
* ServiceRecord{440b7d68 u0 cloudtv.hdwidgets/.services.WidgetUpdaterService}
app=ProcessRecord{430c05b0 15158:cloudtv.hdwidgets/u0a259}
TaskRecord{45ef1980 #93 A=cloudtv.hdwidgets U=0 sz=1}
Intent { act=cloudtv.hdwidget.weather.SHOW_WEATHER_ACTIVITY flg=0x10000000
cmp=cloudtv.hdwidgets/.activities.MainActivity (has extras) }
Hist #0: ActivityRecord{443bdf18 u0 cloudtv.hdwidgets/.activities.MainAc
tivity t93}
Intent { act=cloudtv.hdwidget.weather.SHOW_WEATHER_ACTIVITY flg=0x1000
0000 cmp=cloudtv.hdwidgets/.activities.MainActivity bnds=[23,1179][248,1336] (ha
s extras) }
ProcessRecord{430c05b0 15158:cloudtv.hdwidgets/u0a259}
TaskRecord{45ef1980 #93 A=cloudtv.hdwidgets U=0 sz=1}
Run #0: ActivityRecord{443bdf18 u0 cloudtv.hdwidgets/.activities.MainAct
ivity t93}
mResumedActivity: ActivityRecord{443bdf18 u0 cloudtv.hdwidgets/.activities.M
ainActivity t93}
mFocusedActivity: ActivityRecord{443bdf18 u0 cloudtv.hdwidgets/.activities.Mai
nActivity t93}
* Recent #0: TaskRecord{45ef1980 #93 A=cloudtv.hdwidgets U=0 sz=1}
Proc # 0: fore F/A/T trm: 0 15158:cloudtv.hdwidgets/u0a259 (top-activity)
and there, in all that junk, i found:
Code:
Intent { act=cloudtv.hdwidget.weather.SHOW_WEATHER_ACTIVITY flg=0x10000000
A quick search on how to fire activities from tasker, and i had finally solved the problem!
ИΘΘK¡€ said:
@Angry Black Man,
Code:
su
am start -n [package name found in /data/app or /system/app]/[activity name you memorized/wrote down]
For example, to execute the activity to start Developer Options, I would use this:
Code:
su
am start -n com.android.settings/.DevelopmentSettings
Click to expand...
Click to collapse
What does the -n do ? I can start it without using that and don't see anything that it does.
I enter , am start ,
and it shows list of commands for that, I don't see what -n is for.
@ryan012, I actually don't know for sure, but the syntax listed says [-n <component>] about the "-n" tag. You can look for more info here.

[Completed] I have an issue. I do not know if my code modification or my device is to blame.

Info:
my device is rooted (fully) and my phone consist of Supersu, Nethunter terminal, bcmon, Reaver.
(below are the codes i modified for my device)
The history
when I first started running reaver i would receive many errors; [...not found] [...can't enable] [...can't change permissions (appearently you can't change permissions within sdcard folder... anyways, moving on.)]
[...no internet connection found]
my point is after looking at the custom scripts I had installed (with notepad++) i noticed that the actual scripts were the big issue. so I started changing things one by one in-order to not mess-up everything. yeah sure, I made some errors that made things last longer- way longer than normal. Nevertheless, at some point I actually started making things better and slowly started knocking down those errors!! until i hit the 'test' button and sure enough
"Cannot link executable... libfake_driver.so is 32 instead of 64.... only PIE are supported."
Truth Be Told
as you might can tell from the kind of question I'm asking, I am not an expert.
And I understand these kind of questions comes with others looking at the questioner as annoying- and with the thought of 'these beginners just want everyone to give answers instead of learning themselves...' It's NOT COMPLETELY wrong, since now days a comment like such is ... pretty much true-
So i'll say this: Not Every One Is The Same.
I am a programmer. my programming is mostly within game design/ game development so if more coding is needed to solve my issue at hand, then let me know and please (at the lease) point me in the right direction.
if I need to google something, please clarify what to search. For I am just one person, so it is possible I haven't thought of something to type in- however, that does not mean I haven't type MANY searches in already.
The Question
Am I able to use Rfa and bcmon on nexus 5x, and if so, then what is needed to get my phone operating (the app(s)) correctly? This is the complete error i am receiving in RfA.
CANNOT LINK EXECUTABLE: "/system/app/bcmon/assets/libs/libfake_driver.so" is 32-bit instead of 64-bit page record for 0x7f98e8c010 was not found (block_size=64)
error: only position independent executables (PIE) are supported.
My Done Work
with the rfa settings you can choose to use custom scripts the following shows the scripts i used and it's placement.
these scripts i had to modify to get the device's errors fixed ( not all though )
Activation Script:
#!/bin/bash
svc wifi disable
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/data/sdcard/bcmon/assets/libs/libfake_driver.so sh
cd /sdcard/bcmon/assets/tools
./enable_bcmon
echo “rfasuccess”
exit
Warm-up Script
#!/bin/bash
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/sdcard/bcmon/assets/libslibfake_driver.so sh
cd /sdcard/bcmon/assets/tools
Stop Script
#!/bin/bash
svc wifi enable
echo “rfasuccess”
Will you care to help me?
Hi,
Try posting your question here:
http://forum.xda-developers.com/google-nexus-5/help
The experts there may be able to help.
Good luck!

I have an issue. I do not know if my code modification or my device is to blame.

Info:
my device is rooted (fully) and my phone consist of Supersu, Nethunter terminal, bcmon, Reaver.
(below are the codes i modified for my device)
The history
when I first started running reaver i would receive many errors; [...not found] [...can't enable] [...can't change permissions (appearently you can't change permissions within sdcard folder... anyways, moving on.)]
[...no internet connection found]
my point is after looking at the custom scripts I had installed (with notepad++) i noticed that the actual scripts were the big issue. so I started changing things one by one in-order to not mess-up everything. yeah sure, I made some errors that made things last longer- way longer than normal. Nevertheless, at some point I actually started making things better and slowly started knocking down those errors!! until i hit the 'test' button and sure enough
"Cannot link executable... libfake_driver.so is 32 instead of 64.... only PIE are supported."
Truth Be Told
as you might can tell from the kind of question I'm asking, I am not an expert.
And I understand these kind of questions comes with others looking at the questioner as annoying- and with the thought of 'these beginners just want everyone to give answers instead of learning themselves...' It's NOT COMPLETELY wrong, since now days a comment like such is ... pretty much true-
So i'll say this: Not Every One Is The Same.
I am a programmer. my programming is mostly within game design/ game development so if more coding is needed to solve my issue at hand, then let me know and please (at the lease) point me in the right direction.
if I need to google something, please clarify what to search. For I am just one person, so it is possible I haven't thought of something to type in- however, that does not mean I haven't type MANY searches in already.
The Question
Am I able to use Rfa and bcmon on nexus 5x, and if so, then what is needed to get my phone operating (the app(s)) correctly? This is the complete error i am receiving in RfA.
CANNOT LINK EXECUTABLE: "/system/app/bcmon/assets/libs/libfake_driver.so" is 32-bit instead of 64-bit page record for 0x7f98e8c010 was not found (block_size=64)
error: only position independent executables (PIE) are supported.
My Done Work
with the rfa settings you can choose to use custom scripts the following shows the scripts i used and it's placement.
these scripts i had to modify to get the device's errors fixed ( not all though )
Activation Script:
#!/bin/bash
svc wifi disable
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/data/sdcard/bcmon/assets/libs/libfake_driver.so sh
cd /sdcard/bcmon/assets/tools
./enable_bcmon
echo “rfasuccess”
exit
Warm-up Script
#!/bin/bash
LD_LIBRARY_PATH=/sdcard/bcmon/assets/libs
LD_PRELOAD=/sdcard/bcmon/assets/libslibfake_driver.so sh
cd /sdcard/bcmon/assets/tools
Stop Script
#!/bin/bash
svc wifi enable
echo “rfasuccess”
Will you care to help me?

Copy text to clipboard in shell

Interacting with the Clipboard from the shell can be difficult.
It used to be easier and you could use service call clipboard ...
Nowadays Clipboard only takes ClipData.
Ok, you could still do it using the service executable but you'd have a long list of opaque numbers.
I wrote a regular executable (not using any Java itself) to fill the Clipboard with your text.
It works for UTF-8, although I haven't gotten it to work pretty-like on Windows.
(I got the CHCP 65001, but I don't have a font for the console.)
Code:
# /data/local/tmp/copyclip 'I want to go to 中关村科贸电子城.'
This is an ELF64, you have to be rooted, it's a beta and everything is subject to change.
It works on A10. Later Android might need some fixes for attribution tags.
You should rename it to plain "copyclip".
Just park it somewhere (/data/local/tmp is fine) and chmod 755 it.
I've made a few tiny tweaks.
You can do the paste automatically, but there's a rub.
The input keyevent is pretty stupid because it rolls out a whole zygote just to inject a key.
Still, if you don't expect performance you can always:
Code:
# ./copyclip 'The short tedious text' && input keyevent 279
Normally, I do either a USB HID device or a key injector daemon if I want performance.
As noted previously, copyclip itself doesn't roll out a zygote, so it's quick.
Edit: Update again March 7th.
Yet another fine tuning.
I'm thinking about -e processing like echo has.
copyclip can be found in my sig.
Hmm, that's interesting. There were big changes in ClipData from A10 to A11.
This wouldn't work if you are on A11.
There's a two new versions out that works for at least A9, A10 & A11, either 32 bit or 64 bit.
If you're not rooted you'll probably get:
Code:
Error: Package android does not belong to 2000
You'll find it in the sig.
I'd appreciate any feedback on success/failure.
It seems like this would be really useful for entering snippets of Unicode text selected from the desktop.
input text can't handle Unicode.
One of the reasons that I'm having fun with this is the efficiency of not using app_process/Zygote/Java.
Code:
Poke3:/ # time input text Hello
0m00.51s real 0m00.28s user 0m00.20s system
Poke3:/ # time /data/local/tmp/copyclip Hello
0m00.04s real 0m00.01s user 0m00.02s system
Yow! I love talking to myself! I'm 7 posts in and no interruptions from somebody who wants to know something.
I just posted (Win32) adbclip.exe, an amazing accessory that works in concert with (Android) copyclip.
If you're on your desktop you can go to some nice Korean (or Japanese or Arabic or English) website, select some text and then paste it to the Android clipboard!
Amazing, eh?
All the details are in my sig, or more directly: http://www.temblast.com/copyclip.htm.
The Android utility copyclip has been updated:
You can style the text bold with -b and/or italic with -i
You can pipe other shell commands to it: date | /data/local/tmp/copyclip

Categories

Resources