Since Oreo there is this fancy locksettings command, that allows you to change the screenlock from adb shell. Now, if I try to run it on my PC everything is working. On my handheld the command will just get an "Aborted." back. Why is that and how can I run the locksettings command from my device?
here is the code for the locksettings command, maybe you can already tell by that:
# Script to start "locksettings" on the device
#
base=/system
export CLASSPATH=$base/framework/locksettings.jar
exec app_process $base/bin com.android.commands.locksettings.LockSettingsCmd "$#"
Download QUTE, a command panel. Start from the first command click and run it. About 10 to 15 commands ran will give enough control over the system. Only because most of the commands are going to fail, unable to run. Then the terminal will suggest you to STACK, for the command code to lock setting. Copy the code and paste it in the terminal. For there your settings should be locked.
Related
I want to enter a simple adb shell command, so I navigated to ...\sdk\platform-tools\adb.exe, and opened it. However, I am unable to type in it!
What is the solution?
.exe files are executable files for the Windows OS. They will not work on OSX.
There is a program called Terminal that is installed in OSX that you can use to run the adb shell command. You must open up a Terminal and navigate to the directory that is shown in your screenshot, and then you can run the command
./adb shell and it should work.
Alternatively, you can use the Terminal in Android Studio to perform the same operation.
Here is how I change my directory to platform-tools on a mac terminal:
Search the finder for "platform-tools". Then right-click on it, and left-click on "get info". You'll see a little window pop up with all the info for that folder.
Copy the "where", which is the file path.
Then paste into your terminal like this:
cd /Users/[user-name]/Library/Android/sdk/platform-tools
Be sure to add /platform tools on after pasting the path to the folder.
Then hit return. Your terminal should then be pointed to that folder and you can invoke the adb commands by using "./adb [whatever command]".
Or you can invoke adb shell commands: for example let's say you want to enable Analytics Debug mode on an Android device. Use the following command:
adb shell setprop debug.firebase.analytics.app [your_package_name]
I have created an emulator on my mac machine. When I try to launch the emulator manually from avd manager, I am successful. Also, if I launch the emulator on the command line by
emulator -avd nexus5_api21
the emulator starts. But when I write a small shell script to do the same, like
#!/bin/bash
echo "hello"
emulator -avd nexus5_api21
my emulator doesn't start. It complains, that it couldn't find the .ini file. But the same command works, when I do it separately by opening a terminal. I don't have to go to a specific location for running this command successfully.
I don't understand, what the difference between the command line and the shell script is.
You have an error in "shebang line" of your script. It should look like
#!/bin/bash
emulator -avd nexus5_api21
voila!
I would like to advice you to get familiar with shell scripting.
I have one shell script placed in /sdcard/test.sh
And the test.sh file has the below command.
screenrecord --time-limit 10 /sdcard/sreee.mp4
When I run this command from adb shell command from Windows machine command executed successfully without any errors.
My Question is how can I execute the same script from Android app where When I press the start button?
Could you please help me out on this with a best example?
I have an android 4.2 phone on which I wish to run the following script:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
If I put it into and .sh file, and have the SManager app to run it, it does nothing, no error nothing, just get back the console. I allow root access for the app.
If I manually type it into Terminal Emulator, then it works.
How can I run .sh files easily (without much typing) other then SManager, as its obviously not working.
Thank you
All my scripts was ctrl c ctrl v to sh files.
Some windows spec char went into the script, and it did nothing.
As soon as i typed the whole thing in on touchkeyboard,
AND allowed Root run within SManager (it was not enough to start it as rooted only),
it came alive.
Thanks!
I'm trying to deal with some SQLiteDB issues and wanted to use the ABD tool to access my emulators database. When I click on the adb file in the platform-tool file, it opens up but very quickly throws a bunch of text on the window and then closes. Its so fast I can't even tell what it is doing. I tried running as administrator and it didn't change. I'm using Vista if that has anything to do with it.
Any suggestions for how I can even get it to stop from closing so I can enter a command?
You start the command shell (WindowsKey + R, enter cmd in the window that appears and hit Enter.), then use it from there. adb shell is probably the command you need.
C:\> cd \Path\to\platform-tools
C:\Path\to\platform-tools\> adb shell
if you add the path to your environment PATH you don't need to cd there. [This] should be a good example how to do that.
As mentioned by zapl, you need to launch command prompt, add adb directory to path and then running adb commands. You may also be able to pull the trick with DDMS.
In the answer, it was not clear that you have to run a windows cmd.exe terminal program first. Make sure you are in the correct directory, Then start ADB from within this cmd program.
To ensure that windows can find adb.exe ("being in the correct directory), you can either navigate to the location of the adb.exe (usually Platform tools) manually using "cd" command, or update your path statement so that windows can find it regardless of where your cmd.exe prompt is pointing.