<delect id="sj01t"></delect>
  1. <em id="sj01t"><label id="sj01t"></label></em>
  2. <div id="sj01t"></div>
    1. <em id="sj01t"></em>

            <div id="sj01t"></div>

            android面試調試技巧

            時間:2022-12-08 06:31:07 如何面試 我要投稿
            • 相關推薦

            android面試調試技巧

              1. Android adb shell 啟動java程序

            android面試調試技巧

              (1) 進入shell

              C:\Documents and Settings\mawenjian>adb shell

              (2) 看一下命令的幫助

              # am -help

              am -help

              Error: Unknown command: -help

              usage: am [start|instrument]

              am start [-a ] [-d ] [-t ]

              [-c [-c ] ...]

              [-e [-e ...]

              [-n <:COMPONENT>] [-D] []

              am instrument [-e ] [-p ]

              [-w] <:COMPONENT>

              (3) 好了,試一下啟動瀏覽器

              # am start -n com.google.android.browser/com.google.android.browser.BrowserActivity

              am start -n com.google.android.browser/com.google.android.browser.BrowserActivity

              Starting: Intent { comp={com.google.android.browser/com.google.android.browser.BrowserActivity} }

              (4) ok,成功了, 大家試試下面的命令吧:

              # am start -a android.intent.action.VIEW -d http://mwjian.javaeye.com

              am start -a android.intent.action.VIEW -d http://mwjian.javaeye.com

              Starting: Intent { action=android.intent.action.VIEW data=http://mwjian.javaeye.com }

              # am start -a android.intent.action.CALL -d tel:88888888

              am start -a android.intent.action.CALL -d tel:88888888

              Starting: Intent { action=android.intent.action.CALL data=tel:88888888 }

              # am start -a android.intent.action.ALL_APPS

              am start -a android.intent.action.ALL_APPS

              Starting: Intent { action=android.intent.action.ALL_APPS }

              # am start -a android.intent.action.VIEW geo:0,0?q=shanghai

              am start -a android.intent.action.VIEW geo:0,0?q=shanghai

              Starting: Intent { action=android.intent.action.VIEW data=geo:0,0?q=shanghai }

              2. adb mount ,push的使用

              Android 的主要調試工具adb(Android debuging bridge),ddms是一個在adb基礎上的一個圖形化工具。 這里主要講解Android adb,它是一個命令行工具。而ddms功能與adb相同,只是它有一個圖形化界面。對不喜歡命今操作方式的人來說是一個不錯的選擇。這些命令在 Android sdk下的tools目錄下。這些命令在linux和window中都可運行

              (1) 首先確定本機上有一個模擬器已啟動。確定是否有模擬器已啟動可以使用命令:

              adb devices

              List of devices attached

              emulator-5554 device

              emulator-5556 device

              返回一個5554的模擬器。

              (2) 給模擬器安裝一個應用程序,使用命令 adb install

              adb install /home/myname/test.apk

              t在Android adb中,test.apk是一個打包好的應用程序。

              安裝好的程序可以在用adb shell 命令在模擬器目錄/system/app中找到,文件名字都和安裝的一樣。

              (3) 文件傳輸:pc機與模擬機之間的文件傳輸可以使用adb pull 和adb push

              adb pull是把文件從模擬機上復制到pc機上,使用方法如下

              adb pull < remote> < local>

              其中remote代表模擬機文件路徑,local為pc機文件路徑。

              如:adb pull /system/app/test.apk /home/myname/test.apk

              adb push則相返,是把文件從pc機上復制到模擬機上,push可以把任務文件都復制到模擬機上,如果是把一個apk文件上傳到/system/app/下則和adb install作用一樣。使用方法

              adb push < local> < remote>

              大家都明白Android是一個操作系統平臺,啟動一個模擬器就啟動了一個操作系統。可以使用Android adb連接到這個操作系統,并運行一些系統命令,就像平時大家用終端訪問一臺遠程linux/unix服務器。可以使用adb shell。如下進行shell后運行ls命令,在該shell下可運行linux下一些常用的命令,注意:adb shell是只啟動一個模擬器(emulator)的情況,如果啟動了多個模擬器,如剛才使用的adb devices命令返回了兩個模擬器,如果要連接其中一個則加參數-s:使用如:adb -s emulator-5554 shell

              adb shell

              # ls

              sqlite_stmt_journals

              cache

              sdcard

              etc

              init

              init.goldfish.rc

              init.rc

              data

              sys

              system

              proc

              default.prop

              sbin

              root

              dev

              #

              (4) Android adb刪除文件,如果使用adb shell直接進入用rm命令刪除文件是刪不掉的。在adb shell命令前運行adb remount

              $adb remount;

              $adb shell

              #

            【android面試調試技巧】相關文章:

            華為android面試題07-30

            面試的技巧12-16

            面試技巧01-11

            面試的技巧10-14

            面試技巧11-09

            面試的技巧03-18

            經典的面試技巧03-17

            面試技巧心得范文與技巧07-07

            面試技巧之面試禮儀11-10

            流利面試英語面試技巧07-31

            <delect id="sj01t"></delect>
            1. <em id="sj01t"><label id="sj01t"></label></em>
            2. <div id="sj01t"></div>
              1. <em id="sj01t"></em>

                      <div id="sj01t"></div>
                      黄色视频在线观看