http://www.android-doc.com/tools/help/MonkeyImage.html
阅读全文Java中的Atomic类
Atomic类用于保证变量操作的原子性,先记录,有时间再进行研究 :-(
阅读全文ubuntu14.04编译Android4.4源码注意事项
需要安装的库(下载代码前): sudo apt-get install curl sudo apt-get install git 需要安装的库(编译前): sudo apt-get install git git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev sudo apt-get install lib32z-dev libgl1-mesa-dev g+
阅读全文repo sync只同步部分代码的方法
每次下载安卓源码都要花1天的多的时间,而且在公司下载几十个G也占用别的人网速,所以对于只关注部分代码的人,可以只同步某些项目,这样节省时间和带宽。 本文所说内容是以你repo init成功为基础的。 首先打开源码目录下的.repo目录,打开manifest.xml,里面是一个子项目列表,其中xml节点中的name属性为我们需要用的 比如下载platform/packages/apps/Bluetooth的命令如下:
1 |
~/bin/repo sync platform/packages/apps/Bluetooth |
有的时候这个manifest.xml并没有你想要的那个项目,你可以根据安卓官方的源码结构添加进去,比如下面几个就是
阅读全文使用adb获取Android系统版本号
使用adb shell getprop即可获得Android系统的版本号,如下:
1 2 3 |
获取系统版本:adb shell getprop ro.build.version.release 获取系统api版本:adb shell getprop ro.build.version.sdk |
另外直接执行adb shell getprop还可以获得更多的系统属性,如下是我机器显示的结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
[alsa.mixer.capture.headset]: [Capture] [alsa.mixer.capture.master]: [Capture] [alsa.mixer.playback.headset]: [Headphone] [alsa.mixer.playback.master]: [Playback] [alsa.mixer.playback.speaker]: [Playback] [back_camera_name]: [adv7180_decoder] [back_camera_orient]: [0] [camera.disable_zsl_mode]: [1] [dalvik.vm.dexopt-flags]: [m=y] [dalvik.vm.heapgrowthlimit]: [64m] [dalvik.vm.heapmaxfree]: [8m] [dalvik.vm.heapminfree]: [512k] [dalvik.vm.heapsize]: [384m] [dalvik.vm.heapstartsize]: [8m] [dalvik.vm.heaptargetutilization]: [0.75] [dalvik.vm.jniopts]: [warnonly] [dalvik.vm.stack-trace-file]: [/data/anr/traces.txt] [debug.egl.hw]: [1] [debug.force_rtl]: [0] [debug.sf.enable_hgl]: [1] [debug.sf.showfps]: [0] [dev.bootcomplete]: [1] [dhcp.wlan0.dns1]: [192.168.8.5] [dhcp.wlan0.dns2]: [114.114.114.114] [dhcp.wlan0.dns3]: [] [dhcp.wlan0.dns4]: [] [dhcp.wlan0.domain]: [] [dhcp.wlan0.gateway]: [192.168.23.1] [dhcp.wlan0.ipaddress]: [192.168.23.100] [dhcp.wlan0.leasetime]: [86400] [dhcp.wlan0.mask]: [255.255.255.0] [dhcp.wlan0.mtu]: [] [dhcp.wlan0.pid]: [1440] [dhcp.wlan0.reason]: [REBOOT] [dhcp.wlan0.result]: [ok] [dhcp.wlan0.server]: [192.168.23.1] [dhcp.wlan0.vendorInfo]: [] [front_camera_name]: [uvc] [front_camera_orient]: [0] [gsm.current.phone-type]: [1] [gsm.network.type]: [Unknown] [gsm.operator.alpha]: [] [gsm.operator.iso-country]: [] [gsm.operator.isroaming]: [false] [gsm.operator.numeric]: [] [gsm.ril.delay]: [15] [gsm.sim.state]: [NOT_READY] [hw.backlight.dev]: [pwm-backlight.0] [hw.bluetooth]: [0] [hwc.enable_dither]: [1] [hwc.stretch.filter]: [1] [init.svc.adbd]: [running] [init.svc.blueletd]: [running] [init.svc.bootanim]: [stopped] [init.svc.console]: [running] [init.svc.debuggerd]: [running] [init.svc.dhcpcd_wlan0]: [running] [init.svc.drm]: [running] [init.svc.healthd]: [running] [init.svc.installd]: [running] [init.svc.keystore]: [running] [init.svc.magd]: [stopped] [init.svc.mcu_server]: [running] [init.svc.media]: [running] [init.svc.netd]: [running] [init.svc.ril-daemon]: [running] [init.svc.sdcard]: [running] [init.svc.servicemanager]: [running] [init.svc.surfaceflinger]: [running] [init.svc.tw8836]: [stopped] [init.svc.ueventd]: [running] [init.svc.vold]: [running] [init.svc.watchdogd]: [running] [init.svc.wifi_mac]: [stopped] [init.svc.wpa_supplicant]: [running] [init.svc.zygote]: [running] [media.omxgm.enable-player]: [1] [media.omxgm.enable-record]: [1] [media.omxgm.enable-scan]: [1] [media.wfd.video-bitrate]: [adaptive] [net.bt.name]: [Android] [net.change]: [net.dns2] [net.dns1]: [192.168.8.5] [net.dns2]: [114.114.114.114] [net.hostname]: [android-4e5bb95fd128e923] [net.qtaguid_enabled]: [1] [net.tcp.buffersize.default]: [4096,87380,110208,4096,16384,110208] [net.tcp.buffersize.edge]: [4093,26280,35040,4096,16384,35040] [net.tcp.buffersize.ethernet]: [524288,2097152,4194304,524288,2097152,4194304] [net.tcp.buffersize.evdo]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.gprs]: [4092,8760,11680,4096,8760,11680] [net.tcp.buffersize.hsdpa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.hspa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.hspap]: [4094,87380,1220608,4096,16384,1220608] [net.tcp.buffersize.hsupa]: [4094,87380,262144,4096,16384,262144] [net.tcp.buffersize.lte]: [524288,1048576,2097152,262144,524288,1048576] [net.tcp.buffersize.umts]: [4094,87380,110208,4096,16384,110208] [net.tcp.buffersize.wifi]: [524288,1048576,2097152,262144,524288,1048576] [persist.sampling_profiler]: [1] [persist.sys.country]: [CN] [persist.sys.dalvik.vm.lib]: [libdvm.so] [persist.sys.language]: [zh] [persist.sys.localevar]: [] [persist.sys.profiler_ms]: [0] [persist.sys.usb.config]: [mtp,adb] [ro.FSL_AAC_PARSER]: [1] [ro.FSL_ASF_PARSER]: [0] [ro.FSL_AVI_PARSER]: [1] [ro.FSL_FLAC_PARSER]: [1] [ro.FSL_FLV_PARSER]: [1] [ro.FSL_MKV_PARSER]: [1] [ro.FSL_MPG2_PARSER]: [1] [ro.FSL_REAL_PARSER]: [0] [ro.adb.secure]: [1] [ro.allow.mock.location]: [1] [ro.baseband]: [unknown] [ro.board.platform]: [imx6] [ro.boot.console]: [ttymxc3] [ro.boot.hardware]: [freescale] [ro.boot.selinux]: [disabled] [ro.boot.serialno]: [0a05a1d4e6b61f90] [ro.bootloader]: [unknown] [ro.bootmode]: [unknown] [ro.build.characteristics]: [tablet] [ro.build.date.utc]: [1508731143] [ro.build.date]: [2017年 10月 23日 星期一 11:59:03 CST] [ro.build.description]: [sabreauto_6q-eng 4.4.3 2.0.0-rc2 20150123 dev-keys] [ro.build.display.id]: [sabreauto_6q-eng 4.4.3 2.0.0-rc2 20150123 dev-keys] [ro.build.fingerprint]: [Freescale/sabreauto_6q/sabreauto_6q:4.4.3/2.0.0-rc2/20150123:eng/dev-keys] [ro.build.host]: [chinatsp] [ro.build.id]: [2.0.0-rc2] [ro.build.product]: [sabreauto_6q] [ro.build.tags]: [dev-keys] [ro.build.type]: [eng] [ro.build.user]: [xuganggen] [ro.build.version.codename]: [REL] [ro.build.version.incremental]: [20150123] [ro.build.version.release]: [4.4.3] [ro.build.version.sdk]: [19] [ro.carrier]: [unknown] [ro.config.alarm_alert]: [Alarm_Classic.ogg] [ro.config.notification_sound]: [OnTheHunt.ogg] [ro.crypto.state]: [unencrypted] [ro.debuggable]: [1] [ro.factorytest]: [0] [ro.hardware.lightsensor]: [/sys/class/i2c-dev/i2c-1/device/1-0044/] [ro.hardware]: [freescale] [ro.kernel.android.checkjni]: [1] [ro.lightsensor.threshold]: [20] [ro.opengles.version]: [196608] [ro.product.board]: [SABREAUTO] [ro.product.brand]: [Freescale] [ro.product.cpu.abi2]: [armeabi] [ro.product.cpu.abi]: [armeabi-v7a] [ro.product.device]: [sabreauto_6q] [ro.product.locale.language]: [en] [ro.product.locale.region]: [US] [ro.product.manufacturer]: [Freescale] [ro.product.model]: [SABREAUTO-MX6Q] [ro.product.name]: [sabreauto_6q] [ro.revision]: [0] [ro.ril.wake_lock_timeout]: [300] [ro.runtime.firstboot]: [86414407] [ro.secure]: [0] [ro.serialno]: [0a05a1d4e6b61f90] [ro.sf.hwrotation]: [0] [ro.sf.lcd_density]: [160] [ro.tether.denied]: [false] [ro.wifi.channels]: [] [ro.zygote.disable_gl_preload]: [true] [rw.VIDEO_RENDER_NAME]: [video_render.surface] [service.bootanim.exit]: [1] [sys.boot_completed]: [1] [sys.emulated.battery]: [1] [sys.interactive]: [active] [sys.settings_global_version]: [2] [sys.sysctl.extra_free_kbytes]: [16200] [sys.usb.config]: [mtp,adb] [sys.usb.state]: [mtp,adb] [system_init.startsurfaceflinger]: [0] [vold.post_fs_data_done]: [1] [wifi.ap.interface]: [wlan0] [wifi.interface]: [wlan0] [wlan.driver.status]: [ok] [wlan.interface]: [wlan0] |
阅读全文
sqlite实现树型结构的查询
此方法不可用!!! 使用RowID
1 2 3 4 5 6 7 8 |
select id,bname,parentid,1 as Level from boxes where parentid=0 union all select a.id,a.bname,a.parentid,c.RowID as Level from boxes a inner join boxes b on a.parentid=b.id inner join ( select parentid from boxes group by parentid ) c on a.parentid=c.parentid |
阅读全文
Java实现回形遍历的代码
本来以为这样的回形是有规律可循的,但是找了好长时间没找到,看来只能用遍历了。 x,y的使用有些乱,读者自己理一下吧
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
private String huiXingBianLi(){ final int FLAG_RIGHT = 0; final int FLAG_DOWN = 1; final int FLAG_LEFT = 2; final int FLAG_UP = 3; String resultStr = ""; int flag = FLAG_RIGHT; final int countx = 10; final int county = 11; int x = 0, y = 0; int minx = 0, maxx = county - 1, miny = 1, maxy = countx - 1; int[][] result = new int[countx][county]; int i = 0; while(i < countx * county){ result[y][x] = ++i; if(flag == FLAG_RIGHT){ if(x >= maxx){ maxx--; y++; flag = FLAG_DOWN; continue; }else{ x++; } } if(flag == FLAG_DOWN){ if(y >= maxy){ maxy--; x--; flag = FLAG_LEFT; continue; }else{ y++; } } if(flag == FLAG_LEFT){ if(x <= minx){ minx++; y--; flag = FLAG_UP; continue; }else{ x--; } } if(flag == FLAG_UP){ if(y <= miny){ miny++; x++; flag = FLAG_RIGHT; continue; }else{ y--; } } } resultStr = ""; for(int i1=0; i1 < countx ; i1++){ for(int j1 = 0; j1 < county ; j1++){ if(j1 == 0){ resultStr += String.format(" %03d", result[i1][j1]); }else { resultStr += "..." + String.format("%03d", result[i1][j1]); } } resultStr += "\n"; } return resultStr; } |
阅读全文
使用adb获取android设备中的服务列表
我们可以使用adb shell dumpsys 来查看android设备中的相关服务信息,dumpsys后的参数为相关服务的名称。 比较常用的如:
1 2 3 |
adb shell dumpsys activity adb shell dumpsys alarm |
那么我们如何查看其他我们可以dump的服务名称呢?答案是使用如下的命令即可获得android设备中的所有运行的服务列表
1 |
adb shell service list |
如下,是在我三星手机上运行命令获得的服务列表:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
0 penableservice: [] 1 hermesservice: [com.samsung.android.hermes.IKerykeion] 2 sip: [android.net.sip.ISipService] 3 phone: [com.android.internal.telephony.ITelephony] 4 isms: [com.android.internal.telephony.ISms] 5 iphonesubinfo: [com.android.internal.telephony.IPhoneSubInfo] 6 simphonebook: [com.android.internal.telephony.IIccPhoneBook] 7 handset: [com.gsma.services.utils.IHandset] 8 offhostservice: [com.gsma.services.nfc.IOffHostService] 9 secontroller: [com.gsma.services.nfc.ISEController] 10 nfccontroller: [com.gsma.services.nfc.INfcController] 11 com.broadcom.nfc.Factory: [com.broadcom.nfc.INfcFactory] 12 nfc: [android.nfc.INfcAdapter] 13 telecom: [com.android.internal.telecom.ITelecomService] 14 isub: [com.android.internal.telephony.ISub] 15 sec_analytics: [com.sec.analytics.data.collection.serviceif.IDataCollectionManager] 16 edmnativehelper: [mdm.edmnativehelperservice] 17 imms: [com.android.internal.telephony.IMms] 18 lpnet: [android.os.ILpnetManager] 19 media_projection: [android.media.projection.IMediaProjectionManager] 20 voip: [android.os.IVoIPInterface] 21 launcherapps: [android.content.pm.ILauncherApps] 22 fingerprint: [android.service.fingerprint.IFingerprintService] 23 trust: [android.app.trust.ITrustManager] 24 media_router: [android.media.IMediaRouterService] 25 media_session: [android.media.session.ISessionManager] 26 restrictions: [android.content.IRestrictionsManager] 27 print: [android.print.IPrintManager] 28 assetatlas: [android.view.IAssetAtlas] 29 dreams: [android.service.dreams.IDreamManager] 30 commontime_management: [] 31 samplingprofiler: [] 32 quickconnect: [com.samsung.android.quickconnect.IQuickConnectManager] 33 spengestureservice: [com.samsung.android.smartclip.ISpenGestureService] 34 mDNIe: [com.samsung.android.mdnie.IMdnieManager] 35 diskstats: [] 36 SecExternalDisplayService: [android.os.ISecExternalDisplayService] 37 voiceinteraction: [com.android.internal.app.IVoiceInteractionManagerService] 38 appwidget: [com.android.internal.appwidget.IAppWidgetService] 39 backup: [android.app.backup.IBackupManager] 40 jobscheduler: [android.app.job.IJobScheduler] 41 uimode: [android.app.IUiModeManager] 42 serial: [android.hardware.ISerialManager] 43 usb: [android.hardware.usb.IUsbManager] 44 DockObserver: [] 45 audio: [android.media.IAudioService] 46 wallpaper: [android.app.IWallpaperManager] 47 dropbox: [com.android.internal.os.IDropBoxManagerService] 48 search: [android.app.ISearchManager] 49 country_detector: [android.location.ICountryDetector] 50 location: [android.location.ILocationManager] 51 devicestoragemonitor: [] 52 notification: [android.app.INotificationManager] 53 updatelock: [android.os.IUpdateLock] 54 servicediscovery: [android.net.nsd.INsdManager] 55 sb_service: [com.samsung.android.smartbonding.ISmartBondingService] 56 connectivity: [android.net.IConnectivityManager] 57 rttmanager: [android.net.wifi.IRttManager] 58 wifiscanner: [android.net.wifi.IWifiScanner] 59 msapwifi: [android.net.wifi.IMsapWifiManager] 60 wifi: [android.net.wifi.IWifiManager] 61 wifip2p: [android.net.wifi.p2p.IWifiP2pManager] 62 netpolicy: [android.net.INetworkPolicyManager] 63 netstats: [android.net.INetworkStatsService] 64 network_score: [android.net.INetworkScoreService] 65 textservices: [com.android.internal.textservice.ITextServicesManager] 66 ABTPersistenceService: [com.absolute.android.persistence.IABTPersistence] 67 network_management: [android.os.INetworkManagementService] 68 clipboardEx: [android.sec.clipboard.IClipboardService] 69 clipboard: [android.content.IClipboard] 70 statusbar: [com.android.internal.statusbar.IStatusBarService] 71 enterprise_policy: [android.app.enterprise.IEnterpriseDeviceManager] 72 knox_timakeystore_policy: [com.sec.enterprise.knox.keystore.ITimaKeystore] 73 enterprise_billing_policy: [com.sec.enterprise.knox.billing.IEnterpriseBillingPolicy] 74 mum_container_policy: [com.sec.enterprise.knox.container.IKnoxContainerManager] 75 remoteinjection: [android.app.enterprise.remotecontrol.IRemoteInjection] 76 phone_restriction_policy: [android.app.enterprise.IPhoneRestrictionPolicy] 77 wifi_policy: [android.app.enterprise.IWifiPolicy] 78 application_policy: [android.app.enterprise.IApplicationPolicy] 79 enterprise_license_policy: [android.app.enterprise.license.IEnterpriseLicense] 80 log_manager_service: [android.app.enterprise.ILogManager] 81 sdp: [android.service.sdp.ISdpManagerService] 82 harmony_eas_service: [android.content.IHarmonyEAS] 83 device_policy: [android.app.admin.IDevicePolicyManager] 84 lock_settings: [com.android.internal.widget.ILockSettings] 85 mount: [IMountService] 86 cover: [com.samsung.android.cover.ICoverManager] 87 motion_recognition: [com.samsung.android.motion.IMotionRecognitionService] 88 accessibility: [android.view.accessibility.IAccessibilityManager] 89 input_method: [com.android.internal.view.IInputMethodManager] 90 rcp: [android.os.IRCPManager] 91 bluetooth_secure_mode_manager: [android.bluetooth.IBluetoothSecureManagerService] 92 bluetooth_manager: [android.bluetooth.IBluetoothManager] 93 tactileassist: [android.os.ITactileAssistService] 94 input: [android.hardware.input.IInputManager] 95 window: [android.view.IWindowManager] 96 multiwindow_facade: [com.samsung.android.multiwindow.IMultiWindowFacade] 97 barbeam: [android.app.IBarBeamService] 98 scontext: [android.hardware.scontext.ISContextService] 99 context_aware: [com.samsung.android.contextaware.manager.IContextAwareService] 100 alarm: [android.app.IAlarmManager] 101 consumer_ir: [android.hardware.IConsumerIrService] 102 samsung.smartfaceservice: [com.samsung.android.smartface.ISmartFaceService] 103 CustomFrequencyManagerService: [android.os.ICustomFrequencyManager] 104 CCM: [] 105 cepproxyks: [com.samsung.android.cepproxyks.ISCEPKeystoreService] 106 TUI: [] 107 tima: [android.service.tima.ITimaService] 108 vibrator: [android.os.IVibratorService] 109 sedenial: [android.service.ISEDenialService] 110 ReactiveService: [com.samsung.android.service.reactive.IReactiveService] 111 DirEncryptService: [IDirEncryptService] 112 content: [android.content.IContentService] 113 account: [android.accounts.IAccountManager] 114 persona: [android.os.IPersonaManager] 115 SEAMService: [com.sec.enterprise.knox.seams.ISEAMS] 116 entropy: [] 117 telephony.registry: [com.android.internal.telephony.ITelephonyRegistry] 118 scheduling_policy: [android.os.ISchedulingPolicyService] 119 webviewupdate: [android.webkit.IWebViewUpdateService] 120 usagestats: [android.app.usage.IUsageStatsManager] 121 battery: [] 122 hardware: [android.os.IHardwareService] 123 permission: [android.os.IPermissionController] 124 cpuinfo: [] 125 dbinfo: [] 126 gfxinfo: [] 127 meminfo: [] 128 procstats: [com.android.internal.app.IProcessStats] 129 activity: [android.app.IActivityManager] 130 user: [android.os.IUserManager] 131 package: [android.content.pm.IPackageManager] 132 persona_policy: [android.content.pm.IPersonaPolicyManager] 133 display: [android.hardware.display.IDisplayManager] 134 power: [android.os.IPowerManager] 135 appops: [com.android.internal.app.IAppOpsService] 136 batterystats: [com.android.internal.app.IBatteryStats] 137 sensorservice: [android.gui.SensorServer] 138 mdm.remotedesktop: [mdm.samsung.IRemoteDesktopService] 139 media.sound_trigger_hw: [android.hardware.ISoundTriggerHwService] 140 media.transcoder: [android.media.ITranscoderService] 141 media.audio_policy: [android.media.IAudioPolicyService] 142 listen.service: [com.qualcomm.listen.IListenService] 143 media.camera: [android.hardware.ICameraService] 144 media.player: [android.media.IMediaPlayerService] 145 media.audio_flinger: [android.media.IAudioFlinger] 146 android.security.keystore: [android.security.keystore] 147 SurfaceFlinger: [android.ui.ISurfaceComposer] 148 sensorhubservice: [android.gui.SensorHubServer] 149 display.qservice: [android.display.IQService] 150 drm.drmManager: [drm.IDrmManagerService] 151 batteryproperties: [android.os.IBatteryPropertiesRegistrar] 152 com.samsung.android.jam.IAndroidShm: [com.samsung.android.jam.IAndroidShm] 153 com.samsung.android.jam.IAPAService: [com.samsung.android.jam.IAPAService] 154 com.samsung.android.jam.IJackService: [com.samsung.android.jam.IJackService] 155 TvoutService_C: [android.hardware.ISecExternalDisplayService] |
阅读全文
使用adb查看android设备的屏幕尺寸
使用以下命令可以查看android设备的屏幕尺寸
1 2 3 |
adb shell dumpsys window displays adb shell wm size |
如果两个命令都不能执行就只能自己写程序来获得尺寸了
阅读全文adb shell input命令使用说明
1 2 3 4 5 6 7 |
usage: input ... input text <string> input keyevent <key code number or name> input [touchscreen|touchpad] tap <x> <y> input [touchscreen|touchpad] swipe <x1> <y1> <x2> <y2> input trackball press input trackball roll <dx> <dy> |
1. adb shell input text 向文本框中输入文本,如将光标定位到一个输入框后执行下面的命令:
1 |
adb shell input text bcoder.com |
貌似不能输入中文 输入特殊字符时需要在特殊字符前加上“\”,比如空格(在Mac下测试) 2. adb shell input keyevent 模拟按键,可以是数字、符键或者是功能按键,keyevent后可以是按键的码值或者按键的名称,按键列表见文末的介绍,举例如下:
1 2 3 4 |
//模拟按下数字0键 adb shell input keyevent "KEYCODE_0" //模拟按下返回键 adb shell input keyevent 4 |
3. adb she
阅读全文