Simple Android commands

Source: Internet
Author: User

For Android commands, select a few frequently used records.

1. view the Android version list

Command:

./Android list target

 

2. Create a simulator based on the version number.

Command:

./Android create AVD-N magicyu-T 8

Display:

Created AVD 'mytest' Based on Google APIs (Google Inc .),

With thefollowing hardware config:

HW. LCD. density = 240

VM. heapsize = 24

3. view the created Simulator

Command:

./Android list AVD

Display:

Availableandroid Virtual Devices:

Name: mytest

Path: D: \ hai_software \ android\ android-sdk-windows_r06.setup \. Android \ AVD \ mytest. AVD

Target: Google APIs (Google Inc .)

Based on Android 2.2 (API Level 8)

Skin: wvga800

4. Start the simulator

Command:

./Emulator-AVD mytest

 

5. Select Start skin

View the skin packages under platforms \ Android * \ skins, such as hvga, qvga, and wqvga400.

Command:

./Emulator-AVD magicyu-skin qvga

6. Switch between landscape and portrait screens

Shortcut Key Ctrl + F11

7. Run the ADB command to enter the platform-Tools Folder (Android debug Bridge)

Command:

./Adb.exe Shell

Display:

Display Linux Command Interface

8. View logs

1) Add logs to the program

Log. V (stringtag, string MSG); ------ verbose is lengthy
Log. D (string tag, string MSG); ------ debug
Log. I (string tag, string MSG); ------- info
Log. W (string tag, string MSG); ----- warning
Log. E (string tag, string MSG); ------ Error

2) In the platform-tools directory of the console, enter the view command

Command:

./Adb.exe logcat

Display:

Log Information

9. Process SD card

1) Create an SD card

Command:

$./Mksdcard 1024 m d: mysd. img

2) Start the SD card loading simulator.

Command:

$./Emulator.exe-AVD mytest-sdcard mysd. img

10. Call and send a text message

1) Telnet Logon

Command:

$ Telnet local host 5554

2) call number

Command:

GSM invocation 15555218135

Display:

Display incoming calls on the simulator

3) send text messages

Command:

SMS send 15555218135 hellothis is a message.

Display:

Text message content displayed on the simulator

4) install the APK file on the simulator

./Adb.exe install my.apk

Simulator change memory

$./Emulator.exe-AVD myavd0-partition-size 400

9. View connected devices

ADB Devices

 

10. Check the APK package name installed on your mobile phone.

$ ADB shell PM list package

11. Start the program through the command line

ADB shell am start-N package name/main activity name

12. ADB Super Terminal run CP command prompt cannot find

Your path may be faulty. If CP is unavailable, enter busybox CP.

13. ADB connects multiple devices. The specified device format is ADB-S <Device Name>.

For example, the pull command

adb -s SH0A6PL00243 pull data/data/com.android.tencent/databases/AgendaDetails.db f:\test

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.