Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
98
|
第七章:測試程式碼
[Page-103]
7-5
執行偵錯範例
執行偵錯工具
設定好中斷點之後,在專案上按右鍵選擇
Debug As
(以…偵錯)
Android Application
(圖
7-6
)來執行偵錯工具。
7-6
透過右鍵選單執行偵錯工具
偵錯(
Debugging
|
99
[Page-104]
這基本上是我用來執行
app
的一般程序,我會從
Android
裝置選擇工具
Android Device
Chooser
裡選擇裝置,程式執行到某個想要開始偵錯的中斷點,此時會顯示對話框(圖
7-7
詢問是否開啟偵錯視圖;我選擇「
Yes
(且勾選下方的方框來允許下次的執行)
則開啟偵錯視圖。
7-7
偵錯設定對話框
單步執行程式碼
此時,已顯示偵錯視圖且偵錯器已暫停在我的第一個中斷點(如圖
7-8
);注意到第一
個中斷點(第
28
行)已被突顯出來,現在我可以利用其他工具更加了解這時刻的程式,
特別是利用「變數」(
Variables
)分頁(位於右上角)判斷
VALUE
變數目前的狀態;
在這時間點上會是
null
,因為還沒有如同使用者般地輸入數值。
為了處理下個中斷點,我需要讓偵錯器繼續執行,這可以透過偵錯工具列裡的按鈕
來繼續(
Resume
)(如圖
7-9
),並前往下個中斷點。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861