adb

How to copy some text to android system clipboard using ADB?

纵饮孤独 提交于 2020-01-03 11:02:29
问题 I want to automate some stuff on my rooted android Oreo and can't seem to find a way to copy some text to clipboard. I can paste the copied text adb shell input keyevent 279 so hoping to get some way to copy text also. P.S: not looking for answers suggesting adb shell input text [text] cause it's slow. 回答1: It seems there are 2 ways to copy a text into android clipboard using adb shell . Using service call clipboard 2 i32 1 i32 0 s16 "text" (Deprecated and doesn't work on android 8) Using an

Running shell commands on Android using Runtime.getRuntime

瘦欲@ 提交于 2020-01-03 08:26:10
问题 I am working on a device admin app (has been signed by the manufacturer). I am using it to install other apps using the below adb shell command for android 9 :- cat /sdcard/Download/myfolder/newapp.apk | pm install -S 1528293 and I am just passing it like this:- String command = "cat /sdcard/Download/myfolder/newapp.apk | pm install -S 1528293" Runtime.getRuntime().exec(command); But I get the error "cat unknown option S ". The same command works perfectly fine when I run it from adb shell.

Disable system-level events on Android monkey

扶醉桌前 提交于 2020-01-03 07:23:06
问题 While monkey testing my app % adb shell monkey -p com.foo.bar --throttle 1000 -v 14400 I notice that it accesses various system settings on my device like audio control and taking screen shots. According to http://developer.android.com/tools/help/monkey.html, this is the way it was meant to behave. The Monkey is a program that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. Is

Installing apk on android device via ADB with Java program on Linux

↘锁芯ラ 提交于 2020-01-03 05:17:31
问题 I am trying to pass a path from Java's inbuilt file manager to ADB with java program on Linux to install apk on android device. When the code is executed the apk selected using file manager never gets installed. Here is the code: JFileChooser chooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter( "APK Files", "apk"); chooser.setFileFilter(filter); int returnVal = chooser.showOpenDialog(getParent()); if(returnVal == JFileChooser.APPROVE_OPTION) { System.out

Setting up android phone with eclipse

北城余情 提交于 2020-01-03 05:08:33
问题 I have been developing a project app to learn about android, I can upload my app to my htc desire on my desktop using linux ubuntu and eclipse, I have the same setup on my laptop but I cannot upload apps to my phone. When I try to install the app to the phone it shows up in avd manager as ??????? ????? Unknown, I've googled this and the general advice is to setup a script which I have tried but I get an error message saying path does not exist, when I try to kill the adb server it says no

How to save android runtime error logs in device without connected to PC?

ⅰ亾dé卋堺 提交于 2020-01-02 19:10:11
问题 I just wanna to ask if it is possible to save android runtime error information in sdcard without device connected to PC? I tried to run: adb shell "logcat -v threadtime *:V > /mnt/sdcard/logcat_log.txt" which is lack of runtime error when I plug out the USB. Any thoughts? Thanks for your comments. Here some information I just digged. From the very beginning, I though this command 'adb shell "logcat -v threadtime -f /mnt/sdcard/logcat_log.txt"' will output logs into the file 'logcat_log.txt'

Can't enable DEBUG & VERBOSE for Huawei Android Logcat

我的未来我决定 提交于 2020-01-02 17:21:03
问题 I'm having Huawei Nova Plus I just found that Huawei only displays in its Android log starting log level INFO . Of course I need DEBUG & VERBOSE in my development. I came across this link which is exactly same screens appear to me and I mark the 3 check at the end for " AP Log ", " Charge Log ", & " Sleep Log " when I reboot my mobile, it still behaves the same and only logging is for INFO. I check the project menu again, and I found all log level not checked after reboot. Appreciate help as

How can I change the default directory of the terminal?

若如初见. 提交于 2020-01-02 10:44:33
问题 I want to change the default directory of the Android Studio (v2.2.2) terminal. When i open the terminal it is based on the direcetory of the project. C:\path-of-the-project\ I often have to use adb shell , so i must navigate to the SDK path (platform-tools) to use adb command. Is it possible to change the default directory of the terminal making it point to the SDK-->tools folder? 回答1: You can change the default directory of the Android Studio terminal. Go to File->Settings->Tools->Terminal

How to retrieve the sandbox of my app using Eclipse from my device?

≯℡__Kan透↙ 提交于 2020-01-02 10:24:12
问题 I have an android app which uses sharedPreferences . I run the app in my android device using Eclipse I would like to pull the entire sandbox from the device to desktop so that I can manually see the contents of the sharedPreferences. I clicked DDMS and clicked FileExplorer and saw data folder But its empty. Any help is appreciated ! Thanks in advance ! 回答1: If device is rooted may be it's possible. But in general you can not retrieve the sandbox of your app from your device to pc. But you

android x86 emulator not respecting vm.heapSize

不羁岁月 提交于 2020-01-02 08:54:07
问题 The Android x86 ( API-10 ) emulator does not seem to respect the VM size specified through the AVD manager. See below for config.ini created from AVD manager hw.lcd.density=240 sdcard.size=64M skin.name=WVGA800 skin.path=add-ons/addon-intel_atom_x86_system_image-intel_corporation-10/skins/WVGA800 hw.cpu.arch=x86 abi.type=x86 hw.keyboard=yes vm.heapSize=96 hw.ramSize=256 image.sysdir.1=add-ons/addon-intel_atom_x86_system_image-intel_corporation-10/images/x86/ When I start up the app I print