Common Android commands

Source: Internet
Author: User


* Modify the Hosts file

PC Hosts file address: C:/Windows/System32/Drivers/Hosts
File address of the mobile phone Hosts: after adding the address to/system/etc/hosts, remember to add a line feed. It is easy not to take effect without line breaks.
If the hosts file is read-only and solves the "cannot create/etc/hosts: read-only file system" issue, run the following command su:
Mount-o remount, rw-t yaffs2/dev/block/mtdblock3/system
Echo "127.0.0.1 localhost">/etc/hosts
Cat/etc/hosts check
Alternatively, run the following command to export the file modification and import adb pull/system/etc/hostsadb push/system/etc/hosts again.


* Reading and writing files

Adb push

Adb pull


1. for Android, modify the Sytem read-only permission (Linux Command). 1. Check the mount partition in which the System is mounted. For example, view/dev/block/mmcblk0p25.
2. modify the System permission to read, writemount-o remount, rw-t yaffs2/dev/block/mmcblk0p25/system
Mount all mount-o remount, rw/
2. Set file read/write permissions (Linux Command) chmod 777 fileName

3. view the CPU information of the mobile phone # ls in this directory to view other Information cd proccat cpuinfo

4. Run other adb shell dumpsys commands to view memory
Adb shell ps view Process Information


5. Android myocardial infarction test tool, dumpsys view command http://stackoverflow.com/questions/11201659/android-adb-shell-dumpsys-tool
C: \ Windows \ System32> adb shell
Root @ android:/# dumpsys | grep DUMP
Dumpsys | grep DUMP
Dump of service DeviceManager3LM:
......


* Android decompilation Tool

Apktoolbaksmali decompilation Tool




* AVD-related Windows: Use AVD Manager.exe to download the android command from Linux. Choose Tools> Manage AVDs...
Check whether AVD $ android list targets exists
Available Android targets:
----------
Id: 1 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 2
Skins: WVGA800 (default), WVGA854, WQVGA432, WSVGA, HVGA, WXGA800, WXGA720, QVGA, WQVGA400
ABIs: armeabi-v7a


* Create an Android Project

Android create project-k com. android. tank-a Tank-t 4-p F: \ tank-k/-- package is the namespace (package name)-a/-- name Project name
-P/-- path project-t indicates the version number of the Target Platform
Http://blog.csdn.net/luoxiangyu001/article/details/8838608

Problem D: \ puzzle> android update project -- name Puzzle -- target 8 -- path ./
Error: Target id '8' is not valid. Use 'android. bat list targets' to get the target ids.
Solution D: \ puzzle> android list targets



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.