安卓手机怎么进入命令模式? - 宋马

安卓手机怎么进入命令模式?

1.创建AVD(Android Virtual Device)

2.启动emulator

一般使用Eclipse开发时,开启一个模拟器就是这么一个过程,实则命令行模式下也是这样。刚开始不知道如何命令行启动模拟器的时候就输入了一个emulator,报错了,出现如下提示:

emulator: ERROR: You did not provide the name of an Android Virtual Device

with the ‘-avd ‘ option. Read -help-avd for more information.

If you *really* want to *NOT* run an AVD, consider using ‘-data ‘

to specify a data partition image file (I hope you know what you’re doing).

1.创建AVD

根据提示信息说明,需要先有一个AVD,即一个android的虚拟设备,在命令行输入android create avd,当然前提是在linux中配置好了环境变量,否则会出现找不到命令的错误提示的。如果环境变量配置正确会出现了错误提示信息:

Error: The parameters –name, –target must be defined for action ‘create avd’

Usage:

android [global options] create avd [action options]

Global options:

-s –silent Silent mode: only errors are printed out.

-h –help Help on a specific command.

-v –verbose Verbose mode: errors, warnings and informational messages are printed.

Action “create avd”:

Creates a new Android Virtual Device.

Options:

-c –sdcard Path to a shared SD card image, or size of a new sdcard for the new AVD

-s –skin Skin for the new AVD

-a –snapshot Place a snapshots file in the AVD, to enable persistence.

-n –name Name of the new AVD [required]

-p –path Directory where the new AVD will be created

-t –target Target ID of the new AVD [required]

-f –force Forces creation (overwrites an existing AVD)

请登录后发表评论