Android 7.1.1 multi-user support in emulator - android

I tried to get the multi-user support for my Android 7.1.1 AOSP emulator build on Ubuntu 16.04 64bit. The build gets run with lunch aosp_x86-eng and following the emulator with emulator64-x86.
I tried this solution but with no success:
adb shell
su
setprop fw.max_users 5
The Icon is visible for the first time when I wipe down the status bar, but disappears on releasing it:
Same like here:
adb shell setprop fw.show_multiuserui 1
adb shell setprop fw.max_users 4
I also tried to add an user by adb but without success.
After executing the commands I test it by using:
su
pm get-max-users
result is:
Maximum supported users: 4
Is there a barrier or something like that? Or do I need to edit the build? If I need to root the system, why is the property set to 4 users? And why is the icon shown on the first wipe and disappears after releasing?
Thanks!

Related

How to change the manufacturer property in the Android emulator?

I am running the Android emulator that comes with the Android Studio software. I created an AVD based on Pixel 2. Opening the ADB shell I get:
$ getprop ro.product.manufacturer
unknown
I would like to change the string returned as property ro.product.manufacturer, because I have an app the refuses to run on an "unknown" device. How can I do that?
The file config.ini for the AVD has a line
hw.device.manufacturer=Google
but this does not seem to be the same thing.
despite the old question, I will answer it, as it may be useful for someone when searching.
have you tried using:
$adb shell su root setprop
???

Android Studio see device as null [duplicate]

This question already has answers here:
set up device for development (???????????? no permissions)
(30 answers)
Closed 4 years ago.
On Ubuntu Android Studio shows devices as null.
Every time I turn on my laptop, I need to run the following console commands to add permissions:
./adb devices
./adb kill-server
sudo ./adb devices
Enter my password and then repeat:
./adb kill-server
./adb devices
Note I'm using a xiaomi phone.
Is there a way to get around this permission issues so I don't have to do it ever time.
Anyway, what I did to solve this problem.
Defined in what cases I need to run these commands. For most ubuntu users there is a home folder (hidden file .bashrc).
In which you can record the launch of these commands. But these commands will be triggered when you enter the bash command in the console.
Since I have a shell .zshrc then I did the following:
open console: gedit .zshrc
When the file opens, add the following line:
./.add_device_permissions.sh
After or before, we need to create this file: .add_device_permissions.sh in which we write the following:
#!/bin/bash
# Add permissions for Xiaomi Redmi Note 5
ADB="/home/vadimm/Android/Sdk/platform-tools/adb"
$ADB devices
$ADB kill-server
cat .permissions_redmi_note | sudo -S $ADB devices
$ADB kill-server
cat .permissions_redmi_note | sudo -S $ADB devices
Also we need create .permissions_redmi_note where we need to hardcode our password.
Not to add to the file .zshrc unnecessary we can specify the path when starting the system itself: Startup Applications Preferences
Where we press on "Add" and write our command: /home/vadimm/.add_device_permissions.sh

Set screenlock setting interactively

I want to set the screenlock mode to None in KitKat so I can run CTS.
I'm using the DragonBoard APQ8074 for development from Intrinsyc, and they just released their BSP for Android KitKat 4.4.2. Trouble is, it's unstable and the Security menu in Settings crashes. So I can't use adb shell to input keyevents 19, 20, 21, 22, 23 to navigate.
adb shell settings command seems like it should work for this, but it's not. I tried these commands against 4.2, 4.3 and 4.4, and they seem to assign the values, but they don't visually result in any changes.
shell#msm8974:/ $ settings get system lockscreen_disabled
null
shell#msm8974:/ $ settings put system lockscreen_disabled true
shell#msm8974:/ $ settings get system lockscreen_disabled
true
shell#msm8974:/ $ settings get system screen_brightness
102
shell#msm8974:/ $ settings put system screen_brightness 255
shell#msm8974:/ $ settings get system screen_brightness
255
Now I dunno if lockscreen_disabled is what I want, here, but Settings.java doesn't seem to provide a call to any sort of unlock_mode, so I dunno what else to do. I don't want to write an app to do this, I just want to set screen lock mode to None so I can run CTS. If I need to modify source, then make & flash a new image, I'm willing to do that, but I don't know what to modify. Thanks for any guidance.
Got it figured out.
1. Update settings.db using adb shell
shell#msm8974:/ $ su
shell#msm8974:/ # sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite3> update secure set value=1 where name='lockscreen.disabled';
sqlite3> .quit
2. Move or delete locksettings files
shell#msm8974:/ # mkdir /data/system/lock
shell#msm8974:/ # mv /data/system/locksettings* lock
adb reboot and good to go.
If there is no sqlite installed on the device use the following
1. Set Settings
adb shell settings put secure lockscreen.disabled 1
2. reboot to recovery
adb reboot recovery
3. remove locksettings db files
adb shell rm /data/system/locksettings.db
adb shell rm /data/system/locksettings.db-shm
adb shell rm /data/system/locksettings.db-wal
You should use lockscreen.disabled as the variable name in the setting command, and secure as the name space:
shell#msm8974:/ $ settings put secure lockscreen.disabled 1

adb shell auto-complete under Windows 7

Regarding this post: adb shell auto-complete under Windows 7?
The owner's answer is: "Solved this problem by recompiling adb under cygwin. :)"
Unfortunately I can't send comments asking him how did he recompiled the adb under cygwin.
So my question is: How could I recompile adb under cygwin to get auto-compete working in adb?
EDIT: I realized that actually cygwin is already auto-completing when I type inside android bash, but the text is not being showed. Weird, isn't? E.g:
# ls /data/tem
[TAB]
# ls/data/tem | <<<--- the cursor jumps to here
[ENTER]
It list all files and folders within /data/temp folder.
You can use ADB enhanced Putty
It support auto complete and coloring
you can download it from
ADB Putty
Just start it suing the following command-line:
adb-putty.exe -adb -P 5037 transport-usb
read more at ADB enhanced Putty (replacement for "adb shell" command)
Try PuTTY Tray. Its work for me!
connect to the phone via "adb connect ip:port"
run Putty Tray, select Adb and click "Open"
PS.
You can specify device ID in session settings.
I'm (fortunately) not a Windows user but I guess the problem is not in adb but in your shell that is not letting some keys (i.e. TAB) reach it.
Try this to see if TAB is received by the android shell:
adb shell
# printf '%d\n' "'$(dd bs=1 count=1 2>/dev/null)"
<type TAB+ENTER>
9
If you cannot see 9 (ascii TAB) then your problem is in the Windows shell and you could try cygwin bash to reproduce the test and see the results.
Are you mis-understanding the original post? I think that guy is saying he stopped using the Command Prompt and switched to cygwin.
You can make auto complete work in the Windows command prompt as well. Just run cmd /f instead of cmd. The other post has instructions on how to permanently enable autocomplete.
If you want to use cygwin then focus on trying to get autocomplete to work in cygwin. It's been years since I used cygwin, but I thought it was enabled by default. Maybe you need to turn off case sensitivity? How to deactivate uppercase check in cygwin folder autocompletion?
Regardless which shell you use it will only auto complete folder and file names.

How to run Android instrumentation tests from the command line (in Kubuntu)?

We are able to run instrumentation tests of Android from the command line on Windows by launching:
adb shell
am instrument -w <package.test>/android.test.InstrumentationTestRunner
This gives us good results.
Using the same architecture, we are unable to run the same in Kubuntu.
We have the same setup in Kubuntu.
Can someone let us know, if there are packages with same name.. Then what package will the adb shell point?
How will the emulator connect with adb shell from cmd line?
DO we need to do any changes to do so in Kubuntu ?
You need to explain what errors you are seeing.
If you have the same setup under Kubuntu, i.e. the Android SDK is installed, with tools like adb accessible in your path, then everything should work fine.
In response to your individual points (and these answers are the same on Windows, Mac or Linux):
It is not possible to have more than one Android package installed on a device or emulator with the same package name.
You can connect to the emulator — the same as for any device — by calling adb shell, e.g.:
adb -d shell if you have a single USB-attached device
adb -e shell if you have a single emulator running
adb -s emulator-5554 shell to specify a particular emulator (or device serial number)
You don't need to change anything between operating systems. The difference would be with setting up a device, as you need to modify udev rules on Linux, and install the USB driver on Windows

Categories

Resources