在Android Studio运行Android项目时,黑莓模拟器无法显示?

3

我已经下载并安装了黑莓模拟器,并在VMWare虚拟机中运行它。我已经运行了它的控制器。然后,我在Android Studio中创建了一个简单的“Hello World”项目。这是MainActivity.java代码:

public class MainActivity extends ActionBarActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}
}

以下是XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.vats.vatishs.helloworld.MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!" />
</RelativeLayout>

这是应用程序的 build.gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 18
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.vats.vatishs.helloworld"
    minSdkVersion 11
    targetSdkVersion 18
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:18.+'
}

我先运行BlackBerry ADB代理管理器,然后点击正在运行的BlackBerry模拟器的播放图标。现在,如果我通过单击Android Studio中的绿色运行箭头来运行我的Android项目,则BlackBerry模拟器不会显示在Android设备列表中。我应该怎么做才能在BlackBerry模拟器上运行我的Android代码?


如果将“:appcompat-v7:18.+”更改为“:appcompat-v7:18.0.0”,会发生什么? - mogile_oli
我尝试过的事情:重新启动。安装旧版本的模拟器。将模拟器升级到VMWare的最新版本(在这种情况下,ADB代理管理器甚至没有检测到模拟器,情况更糟)。 - mogile_oli
1个回答

2
我做了以下操作让它在Android Studio中出现:
  1. 你需要进入Android Platform-tools文件夹。
  2. 运行命令

    ./adb connect 你的设备IP地址

  3. 然后,设备应该会出现在Android Studio设备列表中。

** 与你提供给BlackBerry ADB代理管理器的相同。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接