在实体设备上运行您的应用


设置您的设备,如下所示:

  1. 使用一根 USB 电缆将您的设备连接到您的开发机器。 如果您是在 Windows 上开发,可能需要为您的设备安装相应的 USB 驱动程序。如需帮助安装驱动程序,请参阅原始设备制造商 (OEM)USB 驱动程序文档。
  2. 转到Settings > Developer options,在您的设备上启用 USB debugging

    :在 Android 4.2 及更新版本的设备上,Developeroptions 默认处于隐藏状态。如需将其显示出来,请转到Settings > About phone并点按
    Build number七次。返回上一屏幕即可找到 Developer options

从 Android Studio 中运行应用,如下所示:

  1. 在Android Studio 中,选择您的项目,然后点击工具栏中的 Run
  2. Select Deployment Target 窗口中,选择您的设备,然后点击OK

Android Studio 会在您连接的设备上安装并启动应用。

在模拟器上运行您的应用


在模拟器上运行您的应用之前,需要创建一个Android Virtual Device (AVD)定义。AVD 定义可用于定义您想要在Android Emulator 中模拟的 Android电话、平板电脑、Android Wear 或 Android TV 设备的特征。

创建 AVD 定义,如下所示:

  1. 通过选择Tools > Android > AVD Manager,或点击工具栏中AVD Manager 图标,启动 Android Virtual Device Manager
  2. Your Virtual Devices 屏幕中,点击 Create Virtual Device
  3. Select Hardware 屏幕中,选择电话设备(如 Nexus 6),然后点击Next
  4. System Image 屏幕中,选择 AVD 所需的系统映像,然后点击Next

    如果未安装特定的系统映像,则可通过点击Download 链接获取它。

  5. 验证配置设置(对于您的第一个AVD,请将所有设置保持原样),然后点击 Finish

如需了解有关使用AVD 的详细信息,请参阅创建和管理虚拟设备

从 Android Studio 中运行应用,如下所示:

  1. Android Studio 中,选择您的项目,然后点击工具栏中的 Run
  2. Select Deployment Target 窗口中,选择您的模拟器,然后点击OK

模拟器可能需要几分钟时间完成启动。您可能需要将屏幕解锁。解锁后,模拟器屏幕上会出现 My First App

Android Studio官方文档: 如何在你的设备上运行你的程序的更多相关文章

  1. Android Google官方文档解析之——Device Compatibility

    Android is designed to run on many different types of devices, from phones to tablets and television ...

  2. Spring Cloud官方文档中文版-Spring Cloud Config(上)

    官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#spring-cloud-feign 文中例子我做了一些测试在:http ...

  3. Spring Cloud官方文档中文版-Spring Cloud Config(上)-服务端(配置中心)

    官方文档地址为:http://cloud.spring.io/spring-cloud-static/Dalston.SR2/#spring-cloud-feign 文中例子我做了一些测试在:http ...

  4. Android Google官方文档(cn)解析之——Intents and Intent filter

    应用程序核心组件中的三个Activity,service,还有broadcast receiver都是通过一个叫做intent的消息激活的.Intent消息传送是在相同或不同的应用程序中的组件之间后运 ...

  5. Android Google官方文档解析之——System Permissions

    Android is a privilege-separated operating system, in which each application runs with a distinct sy ...

  6. Android Google官方文档解析之——Application Fundamentals

    Android apps are written in the java programming language.The Android SDK tools compile your code-al ...

  7. 【Android Studio安装部署系列】六、在模拟器上运行项目

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 在模拟器上运行项目的步骤.不过在实际开发中,一般不采用这种方式,因为影响电脑的运行,所以一般使用真机运行项目. 运行项目 创建模拟器 ...

  8. Google Android官方文档进程与线程(Processes and Threads)翻译

    android的多线程在开发中已经有使用过了,想再系统地学习一下,找到了android的官方文档,介绍进程与线程的介绍,试着翻译一下. 原文地址:http://developer.android.co ...

  9. python3 asyncio官方文档中文版

    事件循环基类 事件循环基类 事件循环是由asyncio提供的核心执行装置.它提供了多种服务,包括: 注册.执行和关闭延时调用(超时) 为各种通信创建客户端和服务端传输 为一个外部程序通信启动子进程和相 ...

随机推荐

  1. (转)RMAN-06054: media recovery requesting unknown archived log for thread...

    转自:http://blog.itpub.net/29800581/viewspace-1307267/ 使用rman执行recover database 的时候出现RMAN-06054的错误提示: ...

  2. Android, IOS 史上最强多语言国际化,不仅第一次会尾随系统,并且会保存用户的语言设置

    劲爆消息,我提供源代码了.你能够先看完再下载.也能够先下载再看完, android源代码地址: https://github.com/hebiao6446/------Bluetooth-Androi ...

  3. netty reactor线程模型分析

    netty4线程模型 ServerBootstrap http示例 // Configure the server. EventLoopGroup bossGroup = new EpollEvent ...

  4. 9.3 Binder系统_驱动情景分析_服务获取过程

    4. 服务获取过程 test_client客户端: (1)在用户态先构造name=“hello”的数据(服务的名字是hello),调用ioctl发送数据给service_manager(handle= ...

  5. 【AtCoder ABC 075 C】Bridge

    [链接] 我是链接,点我呀:) [题意] 让你求出桥的个数 [题解] 删掉这条边,然后看看1能不能到达其他所有的点就可以了 [代码] #include <bits/stdc++.h> us ...

  6. struts2注入类

    struts2是能够注入一个对象的,那么一定须要继承ModelDriven的泛型接口. package com.test.action; import com.opensymphony.xwork2. ...

  7. WIN32得到HWND

    HWND hwndFound //= FindWindow(_T("RC352_Win32"),NULL); = GetConsoleWindow();

  8. 【z08】乌龟棋

    描述 小明过生日的时候,爸爸送给他一副乌龟棋当作礼物. 乌龟棋的棋盘是一行N个格子,每个格子上一个分数(非负整数).棋盘第1格是唯一的起点,第N格是终点,游戏要求玩家控制一个乌龟棋子从起点出发走到终点 ...

  9. LUA凝视语法

    server端代码已经完毕,client正在优化.游戏不久将上线,近期没事做,老大要我開始学习project Anarchy了.里面代码是比較偏爱的C++,包括lua,暂没学过lua.看了下LUA代码 ...

  10. Java 字符转Unicode

    static String unicode2String(String unicodeStr) { StringBuffer sb = new StringBuffer(); String str[] ...