Installation and debugging of ddms+adt+jdk to develop Android

 

 

 

 

 

 

 

Installation and debugging of ddms+adt+jdk to develop Android

 

 

 

 

 

 

 

content

 

elaboration 1

1   jdk install 1

2   sdk install 3

3   Eclipse installation 6

4   ADT installation 10

5   Ddms use 16

6 emulators use 18 

7 Commands commonly used by   ADB 20

expound

This document is mainly used to build an Android development and testing environment ( DDMS+ADT+JDK ), which can be used for:

1. Create an Android emulator to simulate the operating environment of the Android mobile phone system and experience Android applications. (Convenient when the number of mobile devices is not enough during the test, you can use the simulator instead) to perform various operations.

2. Use the data cable to connect to the real machine, set the mobile phone to the developer option usb debugging mode, you can view the connected device and the corresponding process under ddms , you can add tags to the required process to view its execution and usage, which is convenient for testing Check to see if there is an action, check for bugs .

3. Can create android project to debug the application.

4. Allow developers to develop and use

 

1   jdk installation

 

1. Download jdk for installation first, because eclipse cannot be used immediately after installation, you also need to install jdk and build the environment. ( http://www.java.com/zh_CN/download/manual.jsp#win ), for example, if your computer is 64 -bit, download the corresponding version.

 

 

 

 

2. Double-click to install, click Next to install, without changing its function, you can choose to install to your own directory.

 

 

 

 

3. Click Next, wait for the installation to complete, and click the Finish button.

 

 

 

 

To check whether the JDK is installed successfully, you can open the cmd window and enter java –version to view the version information of the JDK . as the picture shows

 

 

 

2  sdk安装

  1. 1.下载sdkhttps://dl.google.com/android/android-sdk_r24.4.1-windows.zip)进行解压安装,点击SDK Manger进行安装

 

 

 

 

2、勾选需要的安卓版本进行安装,但Tools“Andorid SDK Tools”“Andorid SDK Platform-tools”是必须勾选的(也就是Tools的前两个),“Extras”“Google USB Driver”也是必须勾选的,接着点击install packages进行安装,如下图所示:

 

 

 

3、对左边列表中要安装的选中后点击Accept License

 

 

 

4、等待进行下载安装,这需要很长时间

 

 

 

5、在安装过程中会弹出下图的log,直接点击close关闭就可以

 

 

 

如果安装好了,可以在sdk目录下找到..\andorid-sdk-windows\platforms toolszhge找到这个目录,ADB工具就在这里,如图所示:

 

 

 

  1. 6.复制这个目录的路径,点击计算机选择属性,选择高级系统设置,选择环境变量,新建一个系统变量,命名并把路径复制到变量名中,点击确定,如图所示:

 

 

3  Eclipse安装

  1. 1.下载elcipse.exe进行点击安装,如图选择进行安装,默认选择第一个,点击进行安装

 

 

 

2、出现以下图,可更改安装目录,点击install进行安装

 

 

 

  1. 4.点击接受协议,进行下一步,等待完成安装进度,点击launch进行操作

 

 

 

 

 

 

5、选择工作区设置来发目录,如图所示: 

 

 

 

4  ADT安装

  1. 1.下载解压adthttp://blog.csdn.net/dj0379/article/details/48830699)进行安装,点击eclipsehelp——install new software,点击Add按钮,在name进行命名,点击local进行选择adt文件夹,点击确定。

 

 

2、出现下图所示,选中它,点击next

 

 

 

 

3、等待安装完成,点击next

 

 

 

 

4、接受协议,点击finsh等待安装完成,途中会弹出一个warinning直接忽略点击继续安装就可以,安装完成后eclipse重启

 

 

 5、重启后点击windowpreferences,选择andorid

 

 

 

 

6、在browse中选择sdk文件目录,点击apply,然后点击ok

 

 

 

7、新建一个andoridnew project,选择andorid application project,点击next

 

 

 

 

 

8、进行命名,点击next

 

 

9、接下去全部点击next完成,接着在新建项目右上角点击如图所示,添加ddms

                       

      

 

 

10、就会出现ddms界面,可以对手机进行监控调试,将手机连接电脑,设置手机允许进行usb开发调试

 

 

 

手机连上线后,可以在devices中看见手机,如图所示:

 

 

 

 

5  Ddms使用

1、对某个进程进行监控,可以点击logcat中的+号,进行命名输入pid号,就可以过滤到只剩下需要监控的进程。

 

 

 

 

出现如图所示: 

 

 

 

 

  1. 2.  在面板的右上角有一排很重要的按键他们分别是Debug the selected processUpdate ThreadsUpdate HeapStop ProcessScreenShotEmulator Control通过这个面板的一些功能可以非常容易的使测试终端模拟真实手机所具备的一些交互功能,比如:接听电话,根据选项模拟各种不同网络情况,模拟接受SMS消息和发送虚拟地址坐标用于测试GPS功能等。

 

 

6  模拟器使用

1、打开文件夹运行 AVD Manager.exe,点击“New"创建新的模拟器:

 

 

 

  1. 2.创建一个新的 Android Virtual Device (AVD):输入AVD 名称、选择 Target、输入模拟的 SD Card 的容量大小、以及选择外观皮肤 Skin。然后 “Create AVD”

 

 

 

  1. 3.开始运行你新建的模拟器 Virtual Device:选中这个虚拟设备并点击“Start”,在出现的界面上直接点击“Launch”就可以启动 Android 模拟器了

 

 

  1. 4.最后运行成功

 

 

 

 

7  ADB常用的命令

在电脑中进入cmd窗口,输入执行命令

adb remount
  adb shell
  su
  执行完成之后,你会看到:
  * daemon not running. starting it now *
  * daemon started successfully *

 

    a) adb install <apk文件路径>

      这个命令将指定的apk文件安装到设备上

    b) adb uninstall <软件名>
        adb uninstall -k <软件名>

        如果加 -k 参数,为卸载软件但是保留配置和缓存文件.

    c)adb shell 

       这个命令将登录设备的shell
       adb shell <command命令>,后面加<command命令>将是直接运行设备命令, 相当于执行远程命令

   dadb devices 查看连接的设备

  e) adb start server

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324960515&siteId=291194637