Bundle Identifier格式要求
MyFirstName-MyLastName.FirstAppNameLastAppName
Flutter: Runner.app/Info.plist does not exist. The Flutter “Thin Binary” build phase must run after “Copy Bundle Resources”
Go to Runner(target app) > Build Phases > Run Script and update the run script with the below one.
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build.
Also, verify that Runner(target app) > Build Phases > This Binary contains below scripts as suggested in XCode 11.4 Support by the flutter team.
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed
/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" thin
进入 设置-通用-设备管理
, 然后信任相应的证书
sudo xattr -d com.apple.quarantine [your_flutter_path]/bin/cache/artifacts/libimobiledevice/idevice_id
sudo xattr -d com.apple.quarantine [your_flutter_path]/bin/cache/artifacts/libimobiledevice/ideviceinfo
sudo xattr -d com.apple.quarantine [your_flutter_path]/bin/cache/artifacts/libimobiledevice/idevicesyslog
sudo xattr -d com.apple.quarantine [your_flutter_path]/bin/cache/artifacts/usbmuxd/iproxy
- 找到Android SDK的安装目录,默认为~/Library/Android/sdk/
- AVD模拟设备所在的目录~/.android./avd/
#查看模拟设备列表
~/Library/Android/sdk/tools/emulator -list-avds
#启动某个模拟设备
#格式: ~/Library/Android/sdk/tools/emulator @AVD_name, 如下:
~/Library/Android/sdk/tools/emulator @Pixel_API_23
- 如果报错: Android Emulator Error Message: “PANIC: Missing emulator engine program for 'x86' CPUS.”
#注意顺序 emulator 移动到 tools 的上面,因为最先找到的就执行了,会忽视掉后面同名的
export ANDROID_SDK=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_SDK}/emulator
export PATH=${PATH}:${ANDROID_SDK}/tools
export PATH=${PATH}:${ANDROID_SDK}/platform-tools
运行时会卡在Running 'gradle assembleDebug, 因为Gradle的Maven仓库在国外, 可以使用阿里云的镜像地址
打开项目 -> root/android/build.gradle
buildscript {
repositories {
//修改的地方
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
//修改的地方
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
}
- 修改Flutter的配置文件, 该文件在
Flutter安装目录/packages/flutter_tools/gradle/flutter.gradle
(如果上面配置还不行)
buildscript {
repositories {
//修改的地方
//google()
//jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}