Xcode运行项目时,Xcode报错显示:
The app's bundle identifier “com.fangjunyu.SwiftSlim” is being used by another running app. macOS does not support running iOS or Mac Catalyst apps concurrently with other apps using the same bundle identifier. Please try again after terminating all other processes using the same bundle identifier or changing the bundle identifier of your app.
翻译内容:
该应用的 Bundle Identifier“com.fangjunyu.SwiftSlim”正被另一个正在运行的应用使用。macOS 不支持 iOS 或 Mac Catalyst 应用与其他使用相同 Bundle Identifier 的应用同时运行。请终止所有使用相同 Bundle Identifier 的其他进程,或更改您应用的 Bundle Identifier,然后重试。
这个报错信息表示已经运行一个同Bundle Indentifier的应用,可能是通过启动台或其他方式打开的。
macOS 的运行机制要求:同一时间只能运行一个相同 Bundle Identifier 的 App 实例。
因为系统检测到当前已经有一个进程使用了这个 Bundle Identifier,因此拒绝再次启动。
解决方案为,关闭相同 Bundle Identifier 的 App。
如果无法在当前桌面找到盖应用,可以使用终端退出已运行的 App。
在终端运行:
ps aux | grep App名称
找到对应进程后,直接 kill 掉该进程:
kill -9 进程ID
