android-shell

adb broadcast with user ID

怎甘沉沦 提交于 2020-01-06 20:58:28
问题 I'm trying to broadcast an adb-command to a broadcast-receiver. This would be a very simple task, but the braodcast-receiver has: android:exported="false" On the offical android.developer website, it says: If "false", the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID. So I'm trying to add the user ID to the broadcast. My approach by now is the following adb command: > adb shell am broadcast -a com

Android file permissions on Android 6.0

℡╲_俬逩灬. 提交于 2020-01-01 16:51:56
问题 I want to list files and directories under "/proc" in Android. When running as my application process, many files are not readable. If I list the directory as the shell user I get the following output: shell@flounder:/ $ whoami shell shell@flounder:/ $ /system/bin/toolbox ls -l /proc dr-xr-xr-x root root 2015-09-12 03:30 1 dr-xr-xr-x root root 2015-09-12 03:31 10 dr-xr-xr-x root root 2015-09-12 03:31 101 dr-xr-xr-x shell shell 2015-09-15 03:24 10196 dr-xr-xr-x root root 2015-09-12 03:31 102

Android file permissions on Android 6.0

二次信任 提交于 2020-01-01 16:51:28
问题 I want to list files and directories under "/proc" in Android. When running as my application process, many files are not readable. If I list the directory as the shell user I get the following output: shell@flounder:/ $ whoami shell shell@flounder:/ $ /system/bin/toolbox ls -l /proc dr-xr-xr-x root root 2015-09-12 03:30 1 dr-xr-xr-x root root 2015-09-12 03:31 10 dr-xr-xr-x root root 2015-09-12 03:31 101 dr-xr-xr-x shell shell 2015-09-15 03:24 10196 dr-xr-xr-x root root 2015-09-12 03:31 102

Clear Edit Text - adb

柔情痞子 提交于 2019-12-23 10:19:11
问题 How to clear focused Edit text using shell command. I tried adb shell input keyevent KEYCODE_CLEAR // Not worked adb shell input keyevent KEYCODE_DEL // Delete only one char adb shell input keyevent KEYCODE_FORWARD_DEL // Not worked With this I am only able to delete upto One character only, Is there any way I can delete/clear the focused Edit text. 回答1: This works for me: function clear_input() { adb shell input keyevent KEYCODE_MOVE_END adb shell input keyevent --longpress $(printf 'KEYCODE

adb shell dumpsys window windows output describing

送分小仙女□ 提交于 2019-12-21 04:49:16
问题 I'm using appuim for interaction between my Android device and java code. And I faced with problem that on some kind of devices(including emulators) after pressing on Home button, appium return incorrect current activity (it returns previuos activity which is currently must be minimized). I found that appium used dumpsys window windows with grabbing mFocusedApp value for getting current app. I read another answers about getting Android current activities, and mostly it recommend to use: adb

Using a prebuilt native binary in android app

假装没事ソ 提交于 2019-12-11 02:54:26
问题 this question has been raised in different places but none seem to give a simple detailed explanation of what is required. So far I have built a native binary ffmpeg to be used in android, the build is ok. I have put the binary in my project /lib/armeabi-v7a/ directory and renamed it to libffmpeg.so so it can be picked up by the packaging system, as advised in other posts. Now the issue is that the libffmpeg.so or ffmpeg requires some other libraries which are normally in its( ffmpeg) own lib

ADB: How to automate complete BT Scan, pair and connect

≯℡__Kan透↙ 提交于 2019-12-08 11:06:41
问题 I am looking for Automating the below activities using ADB. Bluetooth settings -> TunrnOn BT -> Pairing (To a BT mac address which i can set) -> Connect to the BT Device on certain profiles like A2DP/HFP. I have already found here and here how to turn on and set BT to discoverable using ADB. But I am still stuck on how to make a connection request again using ADB. Would there be a way to completely automate these steps. Appreciate your valuable comments. 回答1: There is no solution possible

Android file permissions on Android 6.0

泪湿孤枕 提交于 2019-12-04 13:05:29
I want to list files and directories under "/proc" in Android. When running as my application process, many files are not readable. If I list the directory as the shell user I get the following output: shell@flounder:/ $ whoami shell shell@flounder:/ $ /system/bin/toolbox ls -l /proc dr-xr-xr-x root root 2015-09-12 03:30 1 dr-xr-xr-x root root 2015-09-12 03:31 10 dr-xr-xr-x root root 2015-09-12 03:31 101 dr-xr-xr-x shell shell 2015-09-15 03:24 10196 dr-xr-xr-x root root 2015-09-12 03:31 102 dr-xr-xr-x root root 2015-09-12 03:31 103 dr-xr-xr-x root root 2015-09-12 03:31 104 dr-xr-xr-x u0_a15 u0

adb shell dumpsys window windows output describing

南楼画角 提交于 2019-12-03 14:25:45
I'm using appuim for interaction between my Android device and java code. And I faced with problem that on some kind of devices(including emulators) after pressing on Home button, appium return incorrect current activity (it returns previuos activity which is currently must be minimized). I found that appium used dumpsys window windows with grabbing mFocusedApp value for getting current app. I read another answers about getting Android current activities, and mostly it recommend to use: adb shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'" That was the source of the problem,

Query Android content provider from command line (adb shell)

冷暖自知 提交于 2019-11-28 21:16:27
There is a command to start an activity based on intent: am start . Also to send a broadcast: am broadcast . I think probably there should be a shell command to query a content provider, probably something like: query content://com.myapp.authority/path --where 'column=?' --arg 1 --order 'column desc' or similar. Is there one? There is a content command: usage: adb shell content [subcommand] [options] usage: adb shell content insert --uri <URI> [--user <USER_ID>] --bind <BINDING> [--bind <BINDING>...] <URI> a content provider URI. <BINDING> binds a typed value to a column and is formatted: