环境:macos
执行 macaca doctor会报错
因为macaca doctor的机制
源码片段:
check_ANDROID_HOME = function *() {
if (typeof env.ANDROID_HOME !== 'undefined') {
_.pass('ANDROID_HOME is set to `%s`', env.ANDROID_HOME);
var platforms = path.join(env.ANDROID_HOME, 'platforms');
if (!_.isExistedDir(platforms)) {
return _.fail('Android SDK Platforms directory is not exist, please install the whole thing');
}
var res = fs.readdirSync(platforms);
res = _.filter(res, n => {
return /android-\d+/.test(n);
});
if (!res.length) {
return _.fail('Android SDK Platforms directory is not exist, please install the whole thing');
}
注意在ubuntu安卓android-sdk,会自带platforms目录,而是用brew cask按照没有带
解决办法参考:https://stackoverflow.com/questions/45018086/android-studio-wont-use-brew-cask-android-sdk-directory
只需要执行
sdkmanager "platforms;android-27"
就可以了,就会在android-sdk目录生成一个platforms