首页  »   Android

浣跨敤android-寤虹珛绗竴涓狝PP绋嬪簭

网友分享于:2013-12-04  浏览:0次
浣跨敤android--寤虹珛绗竴涓狝PP绋嬪簭

鍦ㄥ紑鍙?a style="background: transparent; color: #ca0c16; margin: 0px; padding: 0px;" target="_blank" href="http://www.meimei689.com/">浜氭床缇庡コ鍥?/a>鐗囨椂锛岄渶瑕佸皢浠g爜鎵撳寘鎴恆ndroid

濡備綍杩愯Android搴旂敤鍙栧喅浜庝袱浠朵簨鎯咃細鏄惁鏈変竴涓狝ndroid璁惧鍜屾槸鍚︽鍦ㄤ娇鐢ˋndroid Studio寮€鍙戠▼搴忋€傛湰鑺傝灏嗕細鏁欎娇鐢ˋndroid Studio鍜屽懡浠よ涓ょ鏂瑰紡鍦ㄧ湡瀹炵殑android璁惧鎴栬€卆ndroid妯℃嫙鍣ㄤ笂瀹夎骞朵笖杩愯搴旂敤銆?/p>

鍦ㄧ湡瀹炶澶囦笂杩愯

濡傛灉鏈変竴涓湡瀹炵殑Android璁惧锛屼互涓嬬殑姝ラ鍙互浣挎垜浠湪鑷繁鐨勮澶囦笂瀹夎鍜岃繍琛屽簲鐢ㄧ▼搴忥細

鎵嬫満璁剧疆

  1. 鎶婅澶囩敤USB绾胯繛鎺ュ埌璁$畻鏈轰笂銆傚鏋滄槸鍦╳indows绯荤粺涓婅繘琛屽紑鍙戠殑锛屼綘鍙兘杩橀渶瑕佸畨瑁呬綘璁惧瀵瑰簲鐨刄SB椹卞姩锛岃瑙?a style="background: transparent; color: #000000; margin: 0px; padding: 0px;" target="_blank" href="http://developer.android.com/tools/extras/oem-usb.html">OEM USB Drivers聽鏂囨。銆?/li>
  2. 寮€鍚澶囦笂鐨?span style="margin: 0px; padding: 0px;">USB璋冭瘯閫夐」銆?
    • 鍦ㄥぇ閮ㄥ垎杩愯Andriod3.2鎴栨洿鑰佺増鏈郴缁熺殑璁惧涓婏紝杩欎釜閫夐」浣嶄簬鈥?span style="margin: 0px; padding: 0px;">璁剧疆>搴旂敤绋嬪簭>寮€鍙戦€夐」鈥濋噷銆?/li>
    • 鍦ˋndriod 4.0鎴栨洿鏂扮増鏈腑锛岃繖涓€夐」鍦ㄢ€?span style="margin: 0px; padding: 0px;">璁剧疆>寮€鍙戜汉鍛橀€夐」鈥濋噷銆?/li>

Note:聽浠嶢ndroid4.2寮€濮嬶紝寮€鍙戜汉鍛橀€夐」鍦ㄩ粯璁ゆ儏鍐典笅鏄殣钘忕殑锛屾兂璁╁畠鍙锛屽彲浠ュ幓璁剧疆>鍏充簬鎵嬫満锛堟垨鑰呭叧浜庤澶?鐐瑰嚮鐗堟湰鍙?/span>涓冩銆傚啀杩斿洖灏辫兘鎵惧埌寮€鍙戜汉鍛橀€夐」浜嗐€?/p>

浠嶢ndroid Studio杩愯绋嬪簭

  1. 閫夋嫨椤圭洰鐨勪竴涓枃浠讹紝鐐瑰嚮宸ュ叿鏍忛噷鐨?span style="margin: 0px; padding: 0px;">Run鎸夐挳銆?/p>

  2. Choose Device绐楀彛鍑虹幇鏃讹紝閫夋嫨Choose a running device鍗曢€夋锛岀偣鍑?span style="margin: 0px; padding: 0px;">OK銆?/p>

Android Studio 浼氭妸搴旂敤绋嬪簭瀹夎鍒版垜浠殑璁惧涓苟鍚姩搴旂敤绋嬪簭銆?/p>

浠庡懡浠よ瀹夎杩愯搴旂敤绋嬪簭

鎵撳紑鍛戒护琛屽苟鍒囨崲褰撳墠鐩綍鍒癆ndriod椤圭洰鐨勬牴鐩綍锛屽湪debug妯″紡涓嬩娇鐢℅radle缂栬瘧椤圭洰锛屼娇鐢╣radle鑴氭湰鎵цassembleDebug缂栬瘧椤圭洰锛屾墽琛屽悗浼氬湪build/鐩綍涓嬬敓鎴怣yFirstApp-debug.apk銆?/p>

Windows鎿嶄綔绯荤粺涓嬶紝鎵ц锛?/p>

gradlew.bat assembleDebug

Mac OS鎴朙inux绯荤粺涓嬶細

$ chmod +x gradlew
$ ./gradlew assembleDebug

缂栬瘧瀹屾垚鍚庡湪app/build/outputs/apk/鐩綍鐢熸垚apk銆?/p>

Note:聽chmod鍛戒护鏄粰gradlew澧炲姞鎵ц鏉冮檺锛屽彧闇€瑕佹墽琛屼竴娆°€?/p>

纭繚 Android SDK閲岀殑聽platform-tools/聽璺緞宸茬粡娣诲姞鍒扮幆澧冨彉閲?code style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12.6px; padding: 0px; color: #c7254e; white-space: nowrap; background-color: #f9f2f4; border-radius: 4px; margin: 0px;">PATH涓紝鎵ц锛?/p>

adb install bin/MyFirstApp-debug.apk

鍦ㄦ垜浠殑Android璁惧涓壘鍒?MyFirstActivity锛岀偣鍑绘墦寮€銆?/p>

鍦ㄦā鎷熷櫒涓婅繍琛?/h2>

鏃犺鏄娇鐢?Android Studio 杩樻槸鍛戒护琛岋紝鍦ㄦā鎷熷櫒涓繍琛岀▼搴忛鍏堣鍒涘缓涓€涓?a style="background: transparent; color: #000000; margin: 0px; padding: 0px;" target="_blank" href="http://developer.android.com/tools/devices/index.html">Android Virtual Device(AVD)銆侫VD 鏄 Android 妯℃嫙鍣ㄧ殑閰嶇疆锛屽彲浠ヨ鎴戜滑妯℃嫙涓嶅悓鐨勮澶囥€?/p>

鍒涘缓涓€涓?AVD:

1. 鍚姩 Android Virtual Device Manager锛圓VD Manager锛夌殑涓ょ鏂瑰紡锛?/p>

* 鐢ˋndroid Studio, **Tools > Android > AVD Manager**,鎴栬€呯偣鍑诲伐鍏锋爮閲岄潰Android Virtual Device Manager![image](avd-manager-studio.png)锛?
* 鍦ㄥ懡浠よ绐楀彛涓紝鎶婂綋鍓嶇洰褰曞垏鎹㈠埌`<sdk>/tools/` 鍚庢墽琛岋細

android avd

2. 鍦ˋVD Manager 闈㈡澘涓紝鐐瑰嚮Create Virtual Device.

3. 鍦⊿elect Hardware绐楀彛锛岄€夋嫨涓€涓澶囷紝姣斿 Nexus 6锛岀偣鍑?span style="margin: 0px; padding: 0px;">Next銆?/p>

4. 閫夋嫨鍒楀嚭鐨勫悎閫傜郴缁熼暅鍍?

5. 鏍¢獙妯℃嫙鍣ㄩ厤缃紝鐐瑰嚮Finish銆?/p>

鏇村AVD鐨勭煡璇嗚闃呰Managing AVDs with AVD Manager.

浠嶢ndroid Studio杩愯绋嬪簭锛?/h3>

1. 鍦ˋndroid Studio閫夋嫨瑕佽繍琛岀殑椤圭洰锛屼粠宸ュ叿鏍忛€夋嫨Run锛?/p>

2.聽Choose Device绐楀彛鍑虹幇鏃讹紝閫夋嫨Launch emulator鍗曢€夋锛?/p>

3. 浠?span style="margin: 0px; padding: 0px;">聽Android virtual device涓嬫媺鑿滃崟閫夋嫨鍒涘缓濂界殑妯℃嫙鍣紝鐐瑰嚮OK锛?/p>

妯℃嫙鍣ㄥ惎鍔ㄩ渶瑕佸嚑鍒嗛挓鐨勬椂闂达紝鍚姩瀹屾垚鍚庯紝瑙i攣鍗冲彲鐪嬪埌绋嬪簭宸茬粡杩愯鍒版ā鎷熷櫒灞忓箷涓婁簡銆?/p>

浠庡懡浠よ瀹夎杩愯搴旂敤绋嬪簭

1. 鐢ㄥ懡浠よ缂栬瘧搴旂敤锛岀敓鎴愪綅浜巃pp/build/outputs/apk/鐨刟pk锛?/p>

2. 纭platform-tools/ 宸叉坊鍔犲埌PATH鐜鍙橀噺锛?/p>

3. 鎵ц濡備笅鍛戒护锛?/p>

adb install app/build/outputs/MyFirstApp-debug.apk

4. 鍦ㄦā鎷熷櫒涓婃壘鍒癕yFirstApp锛屽苟杩愯銆?/p>

浠ヤ笂灏辨槸鍒涘缓骞跺湪璁惧涓婅繍琛屼竴涓簲鐢ㄧ殑鍏ㄩ儴杩囩▼锛?/p>

www.meimei689.com

相关解决方案

最新解决方案