SlideShare a Scribd company logo
1 of 26
Download to read offline
搭建你的Android Studio開發環境
元兒~ 2018.05.15
環境安裝
你需要有Android Studio + Android SDK
建議的作業系統:Unix相關的macOS 或是 Linux
(Ubuntu、Linux Mint、Arch Linux…)
在經驗上比較不會踩到莫名其妙的雷(尤其檔名編碼、
程式碼編碼真的很討厭,還有驅動程式的處理也很麻
煩)
不過嘛...我知道⼤家可能沒什麼意願⽤Linux...

所以環境安裝⽅⾯我還是會以Windows來說明。
Android Studio ≠ Android SDK
Android Studio:
程式碼編輯⼯具、介⾯拖拉⼯具的整合開發環境
Android SDK(必備):
包含Android當前版本所需的函式庫、Google API、模擬器
安裝路徑建議
Windows 中在安裝時不要⽤預設的路徑選項

(如果你的Windows帳號有中⽂名字,⽤預設選項會出錯)
Android Studio建議路徑: C:AndroidAndroid Studio
Android SDK建議路徑: C:AndroidAndroid-SDK
注意!路徑中間不要有中⽂和空格!
macOS/Linux: 照預設即可
Android SDK建議裝在家⽬錄裡⾯的任何路徑,不建議裝在系統資料夾,以免⽇後開發時
缺套件⽽由Android Studio⾃動處理時卡權限問題麻煩。安裝時照預設即可。
從官網下載安裝
https://developer.android.com/studio/
開始安裝
下⼀步…下⼀步…
這邊路徑請指定
C:AndroidAndroid Studio
選擇

Do not import settings
因為你之前沒有開發過Android App,當然沒有先前的設定,
Welcome
下⼀步就對了
設定Android
SDK開發包位置
請設定Android SDK Location



建議放在

C:AndroidAndroid-SDK
接下來就有得等囉...
設定環境變數
在開發過程中會經常⽤到adb指令查看裝置狀態,建議設定環境變數
會比較⽅便些
Windows
進控制台→系統及安全性→進階系統設定→進階→環境變數
在Path那邊加入C:AndroidAndroid-SDKplatform-tools
如下⼀張投影⽚
設定環境變數(macOS/Linux)
(非macOS/Linux的可跳過)
開啟 ~/.bashrc 設定檔,然後加入下⾯兩
⾏:
export ANDROID_HOME=~/Library/
Android/sdk
export PATH=${PATH}:
$ANDROID_HOME/tools:
$ANDROID_HOME/platform-tools
檢查環境變數是否⽣效
開啟命令提⽰字元
Windows 8以上版本中:按下win鍵→鍵入
cmd後按Enter
或是按Win+R鍵→鍵入cmd後按Enter
macOS: 在Launchpad的「其他→終端機」
下adb指令
如果有出現如右圖的字樣就OK
準備拿你⾃⼰的Android⼿機當測試機囉
叫出「開發⼈員選項」
Android裝置: 設定→系統→關於⼿機
然後狂按「版本號碼」好幾下,就會說「你
已經是開發⼈員了」
耶~

開發⼈員選項出現了耶~
開啟USB偵錯模式
進入「開發⼈員選項」
開啟「Android偵錯」

(也有可能是「ADB調拭」)
然後拿USB線接上電腦
測試有沒有成功與電腦連接到
接上之後,⼿機那邊應該會出現「允許
USB偵錯嗎︖」當然就是按「確定」
然後在命令提⽰字元中下達adb devices

看看你⼿機有沒有出現
如果沒出現的話,代表驅動程式有缺,
請⾃⾏去你的⼿機品牌官網找驅動
如果出現unauthorized的話,請看看你
⼿機那邊有沒有確實按下允許USB偵錯
沒有Android裝置的話,也可以使⽤AVD模擬器
adb可以做的事
查看已連線的裝置清單
adb devices
從電腦上的apk檔安裝到⼿機
adb install <apk檔路徑>
傳送檔案到⼿機
adb push <電腦上檔案路徑> <⼿機上要放置的路徑>
進入⼿機的終端機
adb shell
試著建⽴⼀個Hello World專案並丟到⼿
機測試吧
選擇 Start a new Android Studio project
然後就照預設下⼀步...下⼀步...下⼀步............
點選Run ‘app’來測試吧
如果沒出現⾃⼰的⼿機,請回去前幾張投影⽚處理USB偵錯模式的問題
恭喜你!

你的第⼀個App就
出爐了!

More Related Content

What's hot

A Framework Driven Development
A Framework Driven DevelopmentA Framework Driven Development
A Framework Driven Development정민 안
 
Giới thiệu docker và ứng dụng trong ci-cd
Giới thiệu docker và ứng dụng trong ci-cdGiới thiệu docker và ứng dụng trong ci-cd
Giới thiệu docker và ứng dụng trong ci-cdGMO-Z.com Vietnam Lab Center
 
Model-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelModel-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelBob Binder
 
LIFFでLINE公式アカウント上に予約フォームを作成する
LIFFでLINE公式アカウント上に予約フォームを作成するLIFFでLINE公式アカウント上に予約フォームを作成する
LIFFでLINE公式アカウント上に予約フォームを作成するyagi eng
 
Deploy Golang WebApp dengan AWS App Runner
Deploy Golang WebApp dengan AWS App RunnerDeploy Golang WebApp dengan AWS App Runner
Deploy Golang WebApp dengan AWS App RunnerRio Astamal
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraFormWesley Charles Blake
 
Networking in Docker
Networking in DockerNetworking in Docker
Networking in DockerKnoldus Inc.
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Sargis Sargsyan
 
Angular, Buenas Prácticas de Desarrollo de Software
Angular, Buenas Prácticas de Desarrollo de Software  Angular, Buenas Prácticas de Desarrollo de Software
Angular, Buenas Prácticas de Desarrollo de Software Juan G Carmona
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting startedMatheus Marabesi
 
Lezione12: Autenticazione e gestione delle sessioni in REST
Lezione12: Autenticazione e gestione delle sessioni in RESTLezione12: Autenticazione e gestione delle sessioni in REST
Lezione12: Autenticazione e gestione delle sessioni in RESTAndrea Della Corte
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkinsAbe Diaz
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a DockerfileKnoldus Inc.
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJohn Willis
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101Itiel Shwartz
 

What's hot (20)

LIGGGHTS installation-guide
LIGGGHTS installation-guideLIGGGHTS installation-guide
LIGGGHTS installation-guide
 
Packer
Packer Packer
Packer
 
A Framework Driven Development
A Framework Driven DevelopmentA Framework Driven Development
A Framework Driven Development
 
Docker Compose Explained
Docker Compose ExplainedDocker Compose Explained
Docker Compose Explained
 
Giới thiệu docker và ứng dụng trong ci-cd
Giới thiệu docker và ứng dụng trong ci-cdGiới thiệu docker và ứng dụng trong ci-cd
Giới thiệu docker và ứng dụng trong ci-cd
 
Model-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelModel-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next Level
 
LIFFでLINE公式アカウント上に予約フォームを作成する
LIFFでLINE公式アカウント上に予約フォームを作成するLIFFでLINE公式アカウント上に予約フォームを作成する
LIFFでLINE公式アカウント上に予約フォームを作成する
 
Deploy Golang WebApp dengan AWS App Runner
Deploy Golang WebApp dengan AWS App RunnerDeploy Golang WebApp dengan AWS App Runner
Deploy Golang WebApp dengan AWS App Runner
 
Automation with Packer and TerraForm
Automation with Packer and TerraFormAutomation with Packer and TerraForm
Automation with Packer and TerraForm
 
Networking in Docker
Networking in DockerNetworking in Docker
Networking in Docker
 
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
Appium Dockerization: from Scratch to Advanced Implementation - HUSTEF 2019
 
Angular, Buenas Prácticas de Desarrollo de Software
Angular, Buenas Prácticas de Desarrollo de Software  Angular, Buenas Prácticas de Desarrollo de Software
Angular, Buenas Prácticas de Desarrollo de Software
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
 
Lezione12: Autenticazione e gestione delle sessioni in REST
Lezione12: Autenticazione e gestione delle sessioni in RESTLezione12: Autenticazione e gestione delle sessioni in REST
Lezione12: Autenticazione e gestione delle sessioni in REST
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Packer by HashiCorp
Packer by HashiCorpPacker by HashiCorp
Packer by HashiCorp
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Distributed tracing 101
Distributed tracing 101Distributed tracing 101
Distributed tracing 101
 
Infrastructure as code drupal
Infrastructure as code drupalInfrastructure as code drupal
Infrastructure as code drupal
 

Similar to 搭建你的Android Studio開發環境

和Android源代码一起工作 | 海豚浏览器 胡继堂
和Android源代码一起工作 | 海豚浏览器 胡继堂和Android源代码一起工作 | 海豚浏览器 胡继堂
和Android源代码一起工作 | 海豚浏览器 胡继堂imShining @DevCamp
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天Gelis Wu
 
Android gradle 从入门到gg 1
Android gradle 从入门到gg 1Android gradle 从入门到gg 1
Android gradle 从入门到gg 1Jun Liu
 
使用JetBrains Rider開發Xamarin Forms
使用JetBrains Rider開發Xamarin Forms使用JetBrains Rider開發Xamarin Forms
使用JetBrains Rider開發Xamarin FormsChen Yu Pao
 
Android 程式設計(1)
Android 程式設計(1)Android 程式設計(1)
Android 程式設計(1)Roy Wang
 
20140222 Unity Windows lab 移轉實作營
20140222 Unity Windows lab 移轉實作營 20140222 Unity Windows lab 移轉實作營
20140222 Unity Windows lab 移轉實作營 Meng-Ru (Raymond) Tsai
 
Android程式設計(6)
Android程式設計(6)Android程式設計(6)
Android程式設計(6)Roy Wang
 
Orientation Program
Orientation ProgramOrientation Program
Orientation ProgramLuo Korth
 
Android gradle 从入门到gg 0
Android gradle 从入门到gg 0Android gradle 从入门到gg 0
Android gradle 从入门到gg 0Jun Liu
 
基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映heyfluke
 
基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映heyfluke
 
Game development using monogame
Game development using monogameGame development using monogame
Game development using monogamePower Wu
 
Monster Processing Workshop (dayOne)
Monster Processing Workshop (dayOne)Monster Processing Workshop (dayOne)
Monster Processing Workshop (dayOne)Akinori Kinoshita
 
09 creating windows phone game with cocos2d-xna
09   creating windows phone game with cocos2d-xna09   creating windows phone game with cocos2d-xna
09 creating windows phone game with cocos2d-xna乐费 胡
 
Android開發app
Android開發appAndroid開發app
Android開發app騰昱 魏
 

Similar to 搭建你的Android Studio開發環境 (20)

和Android源代码一起工作 | 海豚浏览器 胡继堂
和Android源代码一起工作 | 海豚浏览器 胡继堂和Android源代码一起工作 | 海豚浏览器 胡继堂
和Android源代码一起工作 | 海豚浏览器 胡继堂
 
AS Workshop
AS WorkshopAS Workshop
AS Workshop
 
Java - TA課 - 開發環境
Java - TA課 - 開發環境Java - TA課 - 開發環境
Java - TA課 - 開發環境
 
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天
Visual studio 2012 與 asp.net 4.5 (新功能與開發介紹) 第三天
 
Android_lecture_000
Android_lecture_000Android_lecture_000
Android_lecture_000
 
Android gradle 从入门到gg 1
Android gradle 从入门到gg 1Android gradle 从入门到gg 1
Android gradle 从入门到gg 1
 
使用JetBrains Rider開發Xamarin Forms
使用JetBrains Rider開發Xamarin Forms使用JetBrains Rider開發Xamarin Forms
使用JetBrains Rider開發Xamarin Forms
 
Android 程式設計(1)
Android 程式設計(1)Android 程式設計(1)
Android 程式設計(1)
 
20140222 Unity Windows lab 移轉實作營
20140222 Unity Windows lab 移轉實作營 20140222 Unity Windows lab 移轉實作營
20140222 Unity Windows lab 移轉實作營
 
Android程式設計(6)
Android程式設計(6)Android程式設計(6)
Android程式設計(6)
 
Orientation Program
Orientation ProgramOrientation Program
Orientation Program
 
Android gradle 从入门到gg 0
Android gradle 从入门到gg 0Android gradle 从入门到gg 0
Android gradle 从入门到gg 0
 
Android ADK
Android ADKAndroid ADK
Android ADK
 
Arduino應用程式開發工具
Arduino應用程式開發工具Arduino應用程式開發工具
Arduino應用程式開發工具
 
基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映
 
基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映基于Android ndk的软件开发简介 放映
基于Android ndk的软件开发简介 放映
 
Game development using monogame
Game development using monogameGame development using monogame
Game development using monogame
 
Monster Processing Workshop (dayOne)
Monster Processing Workshop (dayOne)Monster Processing Workshop (dayOne)
Monster Processing Workshop (dayOne)
 
09 creating windows phone game with cocos2d-xna
09   creating windows phone game with cocos2d-xna09   creating windows phone game with cocos2d-xna
09 creating windows phone game with cocos2d-xna
 
Android開發app
Android開發appAndroid開發app
Android開發app
 

搭建你的Android Studio開發環境