Hot answers tagged

14

Running the following command as root should enable USB tethering: service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0) service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3) service call connectivity 34 i32 1 on KitKat (4.4) service call connectivity 30 i32 1 on Lollipop (5.0) service call connectivity 31 i32 1 on Lollipop (5.1) according ...


9

This is due to 2 things: The file does not have execute permissions [AND] The file cannot gain executable permissions as it is on the SD Card. The SD Card's filesystem can accept file permissions, however it is mounted with the noexec flag, as stated in a comment. This stops files being executed. Solution: Copy the net-snmp-5.7.2 directory to the /data/...


8

See the Termux help page for how to input arrow keys using the VolumeUp button, VolumeDown for Ctrl and some additional shortcuts! Volume Up+W → Up arrow key


8

As explained by the comments and Liam's answer, this is due to the noexec flag used by the system when mounting the sdcard. If your configure file is a shell script (as it usually is), you can still trick it to be executed: cd to the directory as you described above, and then execute sh configure. sh is the Shell interpreter, and that binary should be ...


7

When adb shell is executed, the Android side also launches adb which then executes /system/bin/sh -. This path is hard-coded in system/core/adb/services.c: 347 #if ADB_HOST 348 #define SHELL_COMMAND "/bin/sh" 349 #define ALTERNATE_SHELL_COMMAND "" 350 #else 351 #define SHELL_COMMAND "/system/bin/sh" 352 #define ALTERNATE_SHELL_COMMAND "/sbin/sh" 353 #endif ...


7

There is a pretty bad method using adb shell input tap, Get the coordinates for enable tethering and substitute adb shell input tap <x> <y> Or navigate to enable radio using adb shell input keyevent. Just have a look at, adb shell input Again this confines to a particular device.


6

That pretty much depends on two things: the area you're living in the manufacturer's fairness/good will For 1., inside the EU there's a ruling that, put simple, "software changes" such as root won't void your hardware warranty. You might lose "support" concerning software things, but if some hardware component shows problems (e.g. your battery starts ...


6

Try the setprop command below: setprop sys.usb.config rndis,adb


5

I didn't have my Android with me right now to test, but with the Android Terminal Emulator if you go to the menu, you might be able to use the "Command line" or "Initial command" option.


4

Apparently the only (?) way to do this, is by using a named pipe like this: mkfifo myp1 || exit mkfifo myp2 || exit sort list1 >myp1 & sort list2 >myp2 & diff myp1 myp2 rm -f myp1 myp2 This need to be put into a mksh shell function in order to be of any real command line use. Another tricky part seem to be that AOS has implemented some kind ...


4

Took me a while to find this answer, so sharing here... Lollipop uses different routing tables with rules per user and/or interface. Here is a sample when I'm connected on wifi: root@hammerhead:/ # ip rule show 0: from all lookup local 10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system 13000: from all fwmark 0x10063/0x1ffff lookup ...


3

I think you need to wrap $var in quotes. if [ -d "$var" ]; then echo "exists"; fi


3

This is an old question, but I was recently curious about this myself. I found a method that doesn't require recompiling adbd, however it does require su (I'm using Chainfire SuperSu 2.45). Assuming bash is located at /system/bin/bash, and su is at /system/xbin/su, it's essentially something like this: adb shell (use an interactive shell. Invoking this ...


3

Launching apps in Android isn't straightforward. You'll have to use am start combined with certain <PARAMS> to launch the app or a particular section of it. From the comments, it seems that you may want to launch the text file using ES Note Editor. In that case, first identify the activity responsible for the edit window you see when the file is ...


3

Is there a way to create an icon on the home screen that will launch one of these scripts? There is another way (other than this one) if you happen to use Terminal Emulator for Android app. It allows a widget which can be used to execute a script. Install that app, choose Term Shortcut widget in your current launcher. Corresponding to Arguments enter: sh ...


3

You may be in luck; I just finished building git for KBOX2. Once I test it and figure out how to run a staged install for redistribution purposes, I can upload it and post a link EDIT: I've contacted the KBOX2 developer; if the client works hopefully he can package it for download/install to the KBOX2 system. If you're feeling adventurous (or impatient), ...


3

try putting sh in front of your command, eg.: sh ./scp or sh -c ./scp


2

Emulator app should be able to run another app from its own directory. That directory is called something like /data/data/com.super.emulator. Try giving the full path to the app you want in emulator. If you want to get a compiler for Android, you can use NDK. Easy to get, free to use. Can't you also push your file to /system/bin via adb? I don't know if ...


2

I am using the same method and yes SSH is great! But it seems when you SSH to Android it gets a different shell than sh so if you put sh in front of the command it should work. Here's an example: sh /system/bin/pm install app1.apk


2

In addition to this answer you can use the following solution which is taken from rohitverma's answer here and noticed in Lucky's comment. am start -a android.intent.action.VIEW -d <FILEPATH> -t text/plain --activity-clear-task It will execute com.android.internal.app.ResolverActivity activity of android system with all candidates registered ...


2

Modified to use windows timeout command instead of sleep, wake screen first, and only press down once. Twice down enabled wifi tethering on my phone. adb shell input keyevent KEYCODE_WAKEUP && adb shell am start -n com.android.settings/.TetherSettings && adb shell input keyevent KEYCODE_DPAD_DOWN && adb shell input keyevent ...


2

That's rather a shell scripting question to be asked at Super User. Your answer can be found here: Extract filename and extension in bash: for file1 in $SYSAPP*.apk.odex; do mv "${file1}" "${file1%.*}.odex" done for file2 in $SYSPRIVAPP*.apk.odex; do mv "${file2}" "${file2%.*}.odex" done should work on most shells, supposedly. Update: You can ...


2

This is more of a linux question, and it may need to be moved to superuser.se, but I can answer it. On linux, you string commands using && (or || or just ;). With &&, the first command must finish executing and have no error codes in order for the next command in the sequence to run. In your setup, it looks like you want to open an ADB ...


2

The Reason for this failure is that Android blocked chroot for som reason. Like Death Mask Salesman pointed out, it is possible to get information about the command type via type commandName e.g. in this case type chroot. To solve the tmp-mksh: chroot: not found-error it is only required to install BusyBox.


2

I derived a one liner bash command from Firelord's awesome answer: for package in $(adb shell pm list packages -3 | tr -d '\r' | sed 's/package://g'); do apk=$(adb shell pm path $package | tr -d '\r' | sed 's/package://g'); echo "Pulling $apk"; adb pull -p $apk "$package".apk; done Changes/Improvements from original version: Backups only 3rd party apps, ...


2

It doesn't work because adb is a nasty piece of work. For some reason, it deliberately adds carriage return in the output. You can read Gilles' answer for more info on that. All of you've to do is delete the carriage return. Here's the tweaked script of yours: You can use -p with adb pull if only you've version 1.0.32 or above of adb. You were using sort ...


2

We just figured out how to do this for the Desktop Unix case. On Android, you’ll need a directory to place temporary FIFOs at (any will do, such as /sqlite_stmt_journal in Android 2.x and /data/data (if you have the rights to write there) in newer ones). You’ll also need mktemp and mkfifo. (cat is an mksh builtin these days, but on old Android you’ll need to ...


2

The shorter named packages, adb and fastboot are part of android-platform-system-core, and are minimal versions. Likewise, their longer named counterparts belong to android-tools, and are the full versions. apt show <package name> doesn't say much about their differences, except that the adb will break android-tools-adb. The same goes for fastboot. ...


1

You said you use Hacker's Keyboard. If you turn the device into landscape mode Hacker's Keyboard does indeed have all four arrow keys along with ctrl & alt.


1

You can achieve this by writing to the framebuffer directly using dd There's no standard procedure or tool, because the details of what you need to write depend on the framebuffer format in your platform; i.e. it's different for every model of device. dd if=/dev/urandom of=/dev/graphics/fb0 will get you a random colour in every pixel of your framebuffer. (...


Only top voted, non community-wiki answers of a minimum length are eligible