如何启动一个Android虚拟设备没有看到emulator.exe窗口 [英] How to start an Android virtual device without seeing emulator.exe window

查看:715
本文介绍了如何启动一个Android虚拟设备没有看到emulator.exe窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个快捷方式启动特定AVD具体参数。如果我创建批处理文件启动emulator.exe -avd myavd 的emulator.exe命令窗口显示,设备启动后仍然存在。关闭emulator.exe窗口关闭设备。

I want to create a shortcut to start a particular AVD with specific parameters. If I create a batch file with start emulator.exe -avd myavd the emulator.exe command window shows and remains after the device is started. Closing the emulator.exe window closes the device.

我怎么能启动的设备,没有看到这个窗口像AVD管理或者Eclipse呢?

How can I start a device without seeing this window like the AVD Manager or Eclipse does?

推荐答案

创建该Java替代的细节你想要的AVD:

Create this java substituting the details for the avd you want:

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class AVDs
{       
    public static void main(String[] args) throws IOException
    {
        List<String> avdCmd = new ArrayList<String>(args.length + 1);
        avdCmd.add("C:\\Users\\Steve\\AppData\\Local\\Android\\sdk\\tools\\emulator.exe");
        for (String cmdarg: args)
        {
            avdCmd.add(cmdarg);
        }
        ProcessBuilder launch = new ProcessBuilder();
        launch.inheritIO().command(avdCmd).start();
    }
}

然后用这个作为你的快捷方式:

Then use this as your shortcut:

"C:\Program Files\Java\jre1.8.0_40\bin\javaw.exe" -cp "S:\ADT workspace\AVDs\bin" AVDs -timezone Europe/London -avd Lollipop -scale 0.5

替换您的类路径,或删除它,如果你不需要它。请确保您使用的路径javaw进程,不要只使用Java。

Substituting your classpath, or removing it if you don't need it. Make sure you use a path to javaw, don't just use java.

这篇关于如何启动一个Android虚拟设备没有看到emulator.exe窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆