trying to open Data Saver menu using ADB Commands in Android TV 9, Philips 2020. Philips covered stock Network menu using their own, so there is no way to enable/disable Data Saver as it was installed.
https://beebom.com/enable-data-saver-mode-android-tv/
https://source.android.com/devices/tech/connect/data-saver
Any help witch command I can try to display this menu or simply enable/disable Data Saver feature will be appreciated. I connected using ADB my TV with terminal in my PC already.
Commands like that works, no surprise:
adb shell am start -a android.settings.system
But when I tried to use more complex ones I get errors, nothing opens on the TV. I based on this doc - https://developer.android.com/reference/android/provider/Settings
adb shell am start -a android.settings.SETTINGS.system
Starting: Intent { act=android.settings.SETTINGS.system } Error: Activity not started, unable to resolve Intent { act=android.settings.SETTINGS.system flg=0x10000000 }
If there is a command to do so, I can map it later using Button Mapper, so it will be more user friendly in daily use.
Related
Have joined a new company and am new to android ui. What is the best way to see which activity in code relates to ui which am seeing in emulator or device?
Run the app on a device and make sure the device is connected to your machine. In your terminal, run:
adb shell dumpsys activity | grep -i 'resumedactivity\|focusedactivity'
This will output the name of the activity that is currently being displayed
Did anyone tried Android multiple display feature which is new in Android O
Following steps which is not working for me
1.connect hdmi cable to mobile(not sure can use USB as well)
2.make device in root and give following command (expect app is installed)
and not seen that app is launching on secondary(Multiple display feature
) it's just reflecting mobile display as it is because connected hdmi cable
adb shell am start com.Chrome.Canary --display 1
Please suggest any other way or any command to make it work?
Android in general do mirroring when two displays are connected. Right now google has not enabled support for touch and display mapping on the two displays. But if you want to launch any activity on any of the two displays then the command adb shell am start "your_activity" --display display_id will launch your activity on that particular display id. If the above command doesn't launch your activity then you can use adb shell am stack start display_id "your activity". This will also work. But regarding touch, it will be mapped to the primary display (display id 0). As per google you can enable the mapping of touch in EventHub.cpp of Android source code but till now I haven't found it useful. Hope my answer helps you.
Ran using below procedure passed with dell monitor:
ADB shell can be used to call Activity Manager(am) for starting any system actions (or an activity).
The syntax:
adb shell am start [-n (component)] [-a (action)] [-t (mime type)] [-d (data_URL)]
examples:
1. For starting ‘Settings app’:
adb shell am start -n com.android.settings/.Settings
In the above-mentioned command, we set component(-n) to be settings in a specific format.
For starting ‘Gallery app’:
adb shell am start -t image/* -a android.intent.action.VIEW
In the above-mentioned command, we are setting action(-a) for opening the default app for gallery with mime type(-t) to be image/*
In general, for external display the ‘display_id’ starts from ‘1’ in an increasing order, final command to do multi display operation is
adb shell am start -n com.android.settings/.Settings --display 1
The above command will display ‘Settings’ app only in external display with display_id = 1. The primary display will be in the same mode as before executing the command.
I need to launch an app which is in different work profile (Android For Work). If install the app in personal profile then I am able to launch the app from the personal profile on the same device.
However, When I install the app only in the work profile then I am not able to launch the app through adb command.
As per my understanding, google keeps two different containers for personal and work profile. I think the work profile has different space and adb does not have any access to that app and workspace of work profile.
I need to launch the app through appium
If anyone has the answer to the above problem, please answer. Thanks in Advance !
Do you mean launching application on different user account ? check this link please : https://stackoverflow.com/a/24093533/5093606
You can get try to get list of accounts using
adb shell pm list users
and if you working account is there, try
adb shell am start --user WORKING_ACCOUNT com.example.MainActivity
Yes, there is way to launch the apps by using Appium/Adb commands. Instead of appium use adb commands to launch the apps.
The app which you have used for AndroidForWork enrollment, it should be in android:debuggable mode. Set debuggable mode to true and build the apk.
Once the device is enrolled/Configured Androidfor work then get the list of users.
adb shell pm list users UserInfo{0:Drew:13} running UserInfo{10:Work profile:30} running
Get the workprofile user id. In this case 10 is the id. Use the user id to launch the apps.
adb shell am start --user 10 -n "com.android.vending/com.google.android.finsky.activities.MainActivity"
Note: If the provision app is not enabled in Debug mode then you don't have the access to the work profile user.
Turns out I was able to accomplish this with Appium Desktop by adding another parameter to the inspector:
optionalIntentArguments text --user 12
Where '12' is the work profile id you'd see from typing this:
adb -d shell pm list users
Users:
UserInfo{0:Ken Corey:13} running
UserInfo{12:Workspace:50100030} running
I am trying to record my device screen using the shell command as outlined here:
http://developer.android.com/tools/help/adb.html#screenrecord
Using the verbose flag, I am getting a Permission Denial that I think is connected to the fact there is an Owner profile on the device, as it references User 0 and User 1 in the error message.
Does anyone know how I can remove the Owner profile (can't see any options to do so) or how I can set the Owner to user 0?
EDIT - clarification, the error states "broadcast asks to run as user -1 but is calling from user 0"
I got the recording to work.
It seems that for whatever reason, you need to do this via adb shell.
Whilst adb shell is running shell commands on the connected device, running the screenrecord commands directly on the device just doesn't want to work.
I want to be able to open camera app using adb command in video capture mode:
I am already using following command for it:
adb shell am start -a android.media.action.VIDEO_CAPTURE
but if more than one applications have defined that intent then it shows me "Complete action using box". I want to avoid that box. So i wan to open that intent using one particular apk.
How can I can i do it?
If you know the packagename and the activity name of what you want to open then you can use the below
adb shell am start -a android.media.action.VIDEO_CAPTURE -n com.packagename/com.packagename.ActivityName