如题所述
å¨Macç³»ç»ä¸ï¼ä¹å¯ä»¥å®è£
使ç¨Android SDKã并使ç¨adbå·¥å
·æ¥å¯¹å®åç³»ç»è¿è¡è°è¯ã
ä¸è½½å®è£ Android SDK Macçæ¬
åå»å·¦ä¾§ç Download ç®å½ï¼ç¶ååå»å³ä¾§ç DOWLOAD FOR OTHER PLATFORMS ï¼ä»ä¸éæ© SDK Tools Only ä¸ç Mac OS X 32&64 bit æ¥ä¸è½½ã
å 为æ¤æ件æ¯ä¸ä¸ªå缩å ï¼å æ¤æ¨ç´æ¥è§£åå°Macçµèçä»»æä¸ä¸ªç®å½å³å¯ãæ éä»»ä½å®è£ æä½ã
è¿å ¥å°android-sdk-macoxsä¸çToolsæ件夹ï¼åå»Androidæ件ãå³å¯å¯å¨Android SDK Managerã
å 为ï¼Android SDK Manageréè¦æJavaçæ¯æï¼å¦ææ¨ççµè没æå®è£ javaãå第ä¸æ¬¡å¨åå»Andriodæ件çæ¶åï¼ä¼æ示æ¨ä¸è½½Javaï¼è¯·ä¸è½½å®è£ javaã
è³æ¤æ¨å°±å¯ä»¥å¨Android SDK Managerä¸ä¸è½½åæ´æ° Android SDK Tolls å Android SDK Platform-tools ã
adbè°è¯å·¥å ·ä¸è¬ä½äºPlatform-toolsä¸ã
解å³æ æ³ä½¿ç¨adbï¼å¨ä½¿ç¨adbçè¿ç¨ä¸åºç°-bash: adb: command not found
å¨Macç³»ç»ä¸ï¼å¾å¤æ¶å第ä¸æ¬¡å¨Android SDKä¸ä½¿ç¨adbçæ¶åãæ æ³ä½¿ç¨ãä¼æ示-bash: abd: command not foundã
é ææ¤ç±»ç°è±¡çåå æ¯ï¼æªé ç½®Androidçç¯å¢åéãå æ¤ï¼æ¨é为Macä¸çAndroid SDKé ç½®ç¯å¢åéã
å¯å¨Macèªå¸¦çç»ç«¯Terminalã
è¿å ¥å½åç¨æ·çhomeç®å½ã
å¨å½ä»¤è¡è¾å ¥echo $HOME
å建ãbash_profileæ件ã
å½ä»¤è¡è¾å ¥touch .bash_profile
æå¼ãbash_profileæ件ã
å½ä»¤è¡è¾å ¥open -e .bash_profile æ¤å½ä»¤è¡è¾å ¥å®æ¯åï¼ä¼èªå¨å¼¹åº .bash_profile æ件çç¼è¾çªå£
å¨ãbash_profileæ件ä¸è¾å ¥ export PATH=/Users/æ¨çç¨æ·å/æ件路å¾/platform-tools/:$PATH
注æï¼å¦æéè¦æ·»å å¤ä¸ªè·¯å¾å°PATHä¸æ¶ï¼éè¦ç¨âï¼âï¼è±æçåå·ï¼éå¼ãå 为androidåadbè¿äºå½ä»¤æ¯å¨ä¸åçæ件夹ä¸çï¼æ ¼å¼æ¯ï¼PATH=${PATH}:è·¯å¾1:è·¯å¾2ãå¦å¤ï¼å¦ææå®å¤ä¸ªè·¯å¾ï¼ç»å°¾å°±ä¸ç¨åï¼$PATHäºãä¾å¦ï¼
export PATH=${PATH}:/Users/ShaneChen/Documents/android-sdk-macosx/platform-tools:/Users/ShaneChen/Documents/android-sdk-macosx/tools
ä¿åæ件ã
ç´æ¥å ³éãbash_profileæ件ï¼å³å¯èªå¨ä¿åæ¨è¾å ¥çå 容ã
æ´æ°åé ç½®çç¯å¢åé
å¨å½ä»¤è¡ä¸è¾å ¥source .bash_profile
éªè¯é ç½®æ¯å¦æå
è¾å ¥adbï¼å¦æ没æåºç°-bash: adb: command not foundï¼èåºç°adbçå½ä»¤åæ°è§£éãå表æç¯å¢åéé ç½®æåã
å¦ä¸çæªå¾æ¯å¨ç»ç«¯è¾å ¥å½ä»¤è¡ç大è´å 容ã
ä¸è½½å®è£ Android SDK Macçæ¬
åå»å·¦ä¾§ç Download ç®å½ï¼ç¶ååå»å³ä¾§ç DOWLOAD FOR OTHER PLATFORMS ï¼ä»ä¸éæ© SDK Tools Only ä¸ç Mac OS X 32&64 bit æ¥ä¸è½½ã
å 为æ¤æ件æ¯ä¸ä¸ªå缩å ï¼å æ¤æ¨ç´æ¥è§£åå°Macçµèçä»»æä¸ä¸ªç®å½å³å¯ãæ éä»»ä½å®è£ æä½ã
è¿å ¥å°android-sdk-macoxsä¸çToolsæ件夹ï¼åå»Androidæ件ãå³å¯å¯å¨Android SDK Managerã
å 为ï¼Android SDK Manageréè¦æJavaçæ¯æï¼å¦ææ¨ççµè没æå®è£ javaãå第ä¸æ¬¡å¨åå»Andriodæ件çæ¶åï¼ä¼æ示æ¨ä¸è½½Javaï¼è¯·ä¸è½½å®è£ javaã
è³æ¤æ¨å°±å¯ä»¥å¨Android SDK Managerä¸ä¸è½½åæ´æ° Android SDK Tolls å Android SDK Platform-tools ã
adbè°è¯å·¥å ·ä¸è¬ä½äºPlatform-toolsä¸ã
解å³æ æ³ä½¿ç¨adbï¼å¨ä½¿ç¨adbçè¿ç¨ä¸åºç°-bash: adb: command not found
å¨Macç³»ç»ä¸ï¼å¾å¤æ¶å第ä¸æ¬¡å¨Android SDKä¸ä½¿ç¨adbçæ¶åãæ æ³ä½¿ç¨ãä¼æ示-bash: abd: command not foundã
é ææ¤ç±»ç°è±¡çåå æ¯ï¼æªé ç½®Androidçç¯å¢åéãå æ¤ï¼æ¨é为Macä¸çAndroid SDKé ç½®ç¯å¢åéã
å¯å¨Macèªå¸¦çç»ç«¯Terminalã
è¿å ¥å½åç¨æ·çhomeç®å½ã
å¨å½ä»¤è¡è¾å ¥echo $HOME
å建ãbash_profileæ件ã
å½ä»¤è¡è¾å ¥touch .bash_profile
æå¼ãbash_profileæ件ã
å½ä»¤è¡è¾å ¥open -e .bash_profile æ¤å½ä»¤è¡è¾å ¥å®æ¯åï¼ä¼èªå¨å¼¹åº .bash_profile æ件çç¼è¾çªå£
å¨ãbash_profileæ件ä¸è¾å ¥ export PATH=/Users/æ¨çç¨æ·å/æ件路å¾/platform-tools/:$PATH
注æï¼å¦æéè¦æ·»å å¤ä¸ªè·¯å¾å°PATHä¸æ¶ï¼éè¦ç¨âï¼âï¼è±æçåå·ï¼éå¼ãå 为androidåadbè¿äºå½ä»¤æ¯å¨ä¸åçæ件夹ä¸çï¼æ ¼å¼æ¯ï¼PATH=${PATH}:è·¯å¾1:è·¯å¾2ãå¦å¤ï¼å¦ææå®å¤ä¸ªè·¯å¾ï¼ç»å°¾å°±ä¸ç¨åï¼$PATHäºãä¾å¦ï¼
export PATH=${PATH}:/Users/ShaneChen/Documents/android-sdk-macosx/platform-tools:/Users/ShaneChen/Documents/android-sdk-macosx/tools
ä¿åæ件ã
ç´æ¥å ³éãbash_profileæ件ï¼å³å¯èªå¨ä¿åæ¨è¾å ¥çå 容ã
æ´æ°åé ç½®çç¯å¢åé
å¨å½ä»¤è¡ä¸è¾å ¥source .bash_profile
éªè¯é ç½®æ¯å¦æå
è¾å ¥adbï¼å¦æ没æåºç°-bash: adb: command not foundï¼èåºç°adbçå½ä»¤åæ°è§£éãå表æç¯å¢åéé ç½®æåã
å¦ä¸çæªå¾æ¯å¨ç»ç«¯è¾å ¥å½ä»¤è¡ç大è´å 容ã
温馨提示:答案为网友推荐,仅供参考