与桌面操作系统不同,iOS 和 iPadOS 没有提供本地方式来查看 iPhone 和 iPad 上运行的进程。App Store也没有可以帮助您检查设备内部运作的应用程序。
但是,如果您可以访问Mac,则可以查看 iPhone 或 iPad 上运行的进程列表。你只需要Xcode。
在你的 Mac 上安装 Xcode
Xcode 是一种集成开发环境 ( IDE ),可帮助为Apple设备创建软件。它具有一个名为 Instruments 的工具,您可以使用该工具查看 iPhone 或 iPad 上运行的进程列表。您无需成为开发人员,甚至无需付费即可使用它。
Xcode 可在Mac的App Store免费下载。但是,您必须拥有运行 macOS 11.3 Big Sur 或更高版本的Mac才能下载和使用它。(Mac)Xcode 安装还需要至少 12GB 的带宽和磁盘空间,因此您可能需要在继续之前释放 Mac 上的存储空间。(free up storage space on your Mac)
打开 App Store,搜索Xcode,然后选择Get或Download按钮安装Xcode。根据您的互联网连接速度,这可能需要几个小时或更长时间。
设置 Xcode 仪器
下载并安装 Xcode 后,请按照以下步骤查看 iPhone 或 iPad 上运行的进程列表。
1. 打开 Mac 的Launchpad并选择Xcode。
2. 在 Mac 的菜单栏上选择Xcode,指向Open Developer Tool,然后选择标记为Instruments的选项。
那应该加载Xcode Instruments。它是一个性能分析器和可视化工具,可让您记录 iPhone 或 iPad 的 CPU 相关活动(以及我们不会在这里介绍的许多其他内容)。
3. 通过USB将您的 iPhone 或 iPad 连接到您的Mac。然后,解锁 iOS 或 iPadOS 设备并轻点“信任(Trust )” (如果您之前没有将它连接到同一台Mac)。
4. 在Instruments(Instruments)窗口的左上角,打开Choose a profiling template for旁边的菜单。然后,指向[Your Name] iPhone或iPad并选择All Processes。
注意:(Note:)如果您的 iPhone 或 iPad 显示为灰色或“离线(Offline)”,请断开连接并将其重新连接到您的Mac。如果仍然出现这种情况,请移除设备,重新启动Mac,然后重复上述步骤。
5. 选择标有活动监视器(Activity Monitor)的图标并选择选择(Choose)。
6. 选择窗口左上角的录制按钮。(Record)这应该会提示 Instruments 记录并显示您的 iPhone 或 iPad 的CPU活动。
注意:(Note: )一旦您选择“录制”(Record)按钮,乐器可能会立即冻结。这是正常行为,通常持续长达一分钟。
在 Xcode Instruments 中查看进程
Instruments中的活动监视器(Activity Monitor)将以可视格式显示您的 iPhone 或 iPad 的CPU负载,以及窗口底部的运行进程列表。如果您没有看到后者,请按Command + 1切换到Live Processes。
进程 ID( Process ID)和进程名称(Process Name)列帮助您区分进程。其他列(例如% CPU、内存(Memory)和CPU 时间(CPU Time))可让您确定每个进程的CPU使用率、内存消耗和总运行时间。您可以通过选择适当的列对流程进行排序。例如,如果要查看消耗CPU资源最多的进程,请选择% CPU列。
大多数流程都是隐秘的,反映了 iOS 和 iPadOS 中的核心系统功能。例如,bluetoothd是蓝牙(Bluetooth)守护进程背后的进程,它是处理蓝牙(Bluetooth)设备的组件。如果您想识别或了解有关特定流程的更多信息,Google是您的朋友。
但是,您很快就会认出一些,例如在您的 iPhone 或 iPad 上运行的应用程序——例如,Firefox是与(Firefox)Mozilla Firefox相关联的主要进程。
开始(Start)使用您的 iOS 或 iPadOS 设备,您将看到相关服务和应用程序的CPU和内存消耗峰值。强制退出应用程序(稍后会详细介绍)将从列表中删除相关进程。
您还可以通过控制单击并选择添加 [进程] 作为详细信息过滤器(Add [Process] as a Detail Filter)选项来监视特定进程。或者,您可以在窗口左下角的详细过滤器框中输入多个进程(Detail Filter)ID(IDs)(查看进程 ID(Process ID)列) ,以便将它们与其余进程分开查看。
检查完 iPhone 或 iPad 上的进程后,选择Instruments窗口左上角的Stop图标。(Stop)然后,您可以在退出 Xcode 之前选择保存记录的活动(File > Save As )。
iPhone 或 iPad 故障排除
使用 Xcode 查看在 iPhone 或 iPad 上运行的进程列表也可以帮助您排除设备故障。例如,如果您经常遇到死机和崩溃,您也许能够发现问题背后的应用程序或系统服务。然后,您可以在 iPhone 或 iPad 上执行以下修复以解决常见问题。
强制退出应用程序(Force-Quit Apps)
如果某个应用程序似乎总是耗尽CPU、内存或两者兼而有之,那么您的第一个行动方案应该是强制退出。为此,请打开应用程序切换器(App Switcher)(从屏幕底部向上滑动或双击主页(Home)按钮)并从屏幕上删除应用程序。
在Xcode Instruments中,您会注意到该操作有效地关闭了相关进程。然后从主屏幕(Home Screen)重新(Follow)启动应用程序。
更新应用(Update Apps)
应用程序(App)更新附带大量错误修复和性能增强。如果问题仍然存在,请打开App Store并搜索该应用程序。如果有更新,您将看到一个更新(Update)按钮,您可以点击该按钮进行更新。
禁用后台应用刷新(Disable Background App Refresh)
如果 Instruments 显示应用程序使用大量CPU资源和内存,即使您没有主动使用它,请尝试阻止它在后台运行。
为此,请打开Settings应用程序,向下滚动屏幕,选择相关应用程序,然后关闭Background App Refresh旁边的开关。
重启 iPhone 或 iPad(Restart iPhone or iPad)
重新启动 iPhone 或 iPad 可以修复恶意系统进程和内存泄漏。例如,如果 Xcode Instruments显示多个应用程序和系统进程的(Instruments)CPU或内存使用率非常高(没有可解释的原因),请打开Settings应用程序并选择General > Shut Down以关闭设备。然后,等待 30 秒并按住侧面(Side)按钮重新启动它。
更新系统软件(Update the System Software)
更新 iOS 和 iPadOS 通常会修复系统软件的问题。如果您有一段时间尚未更新 iPhone 或 iPad,请打开“设置”(Settings)应用并选择“通用(General)” > “软件更新”( Software Update)以检查并安装最新更新。如果您遇到任何问题,请了解如何修复 iPhone 和 iPad 上卡住的更新(fix stuck updates on iPhone and iPad)。
重置所有设置(Reset All Settings)
重置 iPhone 或 iPad 上的所有设置可解决由设置冲突引起的问题。如果 Xcode Instruments 继续显示高活动,请打开“设置”(Settings)应用并选择“常规(General)” > “传输或重置 iPhone(Transfer or Reset iPhone) ” > “重置(Reset)” > “重置所有设置”(Reset All Settings)。
如果这没有任何作用,那么下一个合乎逻辑的步骤是擦除 iPhone 或 iPad 并将其重置为出厂默认设置(erase and reset your iPhone or iPad to factory defaults)。
内部工作
Xcode提供了一个很好的窗口,可以查看使您的 iPhone 或 iPad 正常工作的进程列表,甚至可以帮助您进行故障排除。诚然,在Mac上设置IDE非常耗时,并且需要大量磁盘空间。但是,如果您有足够的耐心和足够的存储空间,这可能是一个非常有趣的练习。
How To View a List of Processes Running on iPhone or iPad
Unlike desktop operating systems, iOS and iPadOS offer no nativе ways to look into the processes running on the iPhone and іPad. The App Ѕtore is also devоid of aрps that can hеlp you check your device’s inner workings.
However, if you have access to a Mac, you can view a list of processes running on your iPhone or iPad. You just need Xcode.
Installing Xcode on Your Mac
Xcode is an integrated development environment (IDE) that aids software creation for Apple devices. It features a tool called Instruments that you can use to view a list of processes running on your iPhone or iPad. You don’t have to be a developer—or even pay—to use it.
Xcode is available as a free download on the Mac’s App Store. However, you must have a Mac running macOS 11.3 Big Sur or later to download and use it. An Xcode installation also requires at least 12GB of bandwidth and disk space, so you may want to free up storage space on your Mac before going ahead.
Open the App Store, search for Xcode, and select the Get or Download button to install Xcode. Depending on your internet connection’s speed, that can take a couple of hours or longer.
Setting Up Xcode Instruments
Once you’ve downloaded and installed Xcode, go through the steps below to view a list of processes running on your iPhone or iPad.
1. Open the Mac’s Launchpad and select Xcode.
2. Select Xcode on the Mac’s menu bar, point to Open Developer Tool, and pick the option labeled Instruments.
That should load Xcode Instruments. It’s a performance analyzer and visualizer that lets you record an iPhone or iPad’s CPU-related activity (as well as a host of other stuff we won’t be covering here).
3. Connect your iPhone or iPad via USB to your Mac. Then, unlock the iOS or iPadOS device and tap Trust (if you haven’t previously connected it to the same Mac).
4. At the top-left of the Instruments window, open the menu next to Choose a profiling template for. Then, point to [Your Name] iPhone or iPad and select All Processes.
Note: If your iPhone or iPad appears grayed out or “Offline,” disconnect and reconnect it to your Mac. If it continues to appear that way, remove the device, restart your Mac, and repeat the steps above.
5. Pick the icon labeled Activity Monitor and select Choose.
6. Select the Record button at the top-left corner of the window. That should prompt Instruments to record and display your iPhone or iPad’s CPU activity.
Note: Instruments may appear to freeze as soon as you select the Record button. That’s normal behavior and usually lasts for up to a minute.
Viewing Processes in Xcode Instruments
The Activity Monitor in Instruments will display your iPhone or iPad’s CPU load in a visual format, along with a list of running processes toward the bottom of the window. If you don’t see the latter, press Command + 1 to switch to Live Processes.
The Process ID and Process Name columns help you distinguish between processes. Additional columns such as % CPU, Memory, and CPU Time lets you determine CPU usage, memory consumption, and the total runtime for each process. You can sort processes by selecting the appropriate column. For example, if you want to check the processes that consume CPU resources the most, select the % CPU column.
The majority of the processes are cryptic and reflect core system functionalities in iOS and iPadOS. For example, bluetoothd is the process behind the Bluetooth daemon, which is the component that handles Bluetooth devices. If you want to identify or learn more about a specific process, Google is your friend.
However, you’ll quickly recognize a few, such as the apps that run on your iPhone or iPad—e.g., Firefox is the primary process associated with Mozilla Firefox.
Start using your iOS or iPadOS device, and you will see the CPU and memory consumption spike for related services and apps. Force-quitting apps (more on that later) will remove the relevant processes from the list.
You can also monitor a specific process by control-clicking and selecting the Add [Process] as a Detail Filter option. Or, you can input multiple process IDs (look at the Process ID column) into the Detail Filter box at the bottom-left of the window to view them separately from the rest of the processes.
Once you’re done checking the processes on your iPhone or iPad, select the Stop icon at the top-left of the Instruments window. You can then choose to save the recorded activity (File > Save As) before exiting Xcode.
Troubleshooting an iPhone or iPad
Using Xcode to view a list of processes running on an iPhone or iPad can also help you troubleshoot your device. For example, if you experience regular freezes and crashes, you just might be able to spot the app or system service behind the problem. You can then perform the following fixes on your iPhone or iPad to resolve common issues.
Force-Quit Apps
If an app always appears to max out the CPU, memory, or both, your first course of action should be to force-quit. To do that, open the App Switcher (swipe up from the bottom of the screen or double-click the Home button) and remove the app from the screen.
In Xcode Instruments, you’ll notice that the action effectively shuts down the relevant process. Follow by relaunching the app from the Home Screen.
Update Apps
App updates come with loads of bug fixes and performance enhancements. If the problem persists, open the App Store and search for the app. If there’s an update, you’ll see an Update button that you can tap to update it.
Disable Background App Refresh
If Instruments shows an app using lots of CPU resources and memory even when you aren’t actively using it, try stopping it from running in the background.
To do that, open the Settings app, scroll down the screen, select the app in question, and turn off the switch next to Background App Refresh.
Restart iPhone or iPad
Restarting an iPhone or iPad can fix rogue system processes and memory leaks. For example, if Xcode Instruments displays very high CPU or memory usage for multiple apps and system processes (with no explicable reason), open the Settings app and select General > Shut Down to turn off the device. Then, wait for 30 seconds and hold down the Side button to reboot it.
Update the System Software
Updating iOS and iPadOS fixes issues with the system software in general. If you’ve yet to update your iPhone or iPad in a while, open the Settings app and select General > Software Update to check for and install the latest updates. If you run into any issues, learn how to fix stuck updates on iPhone and iPad.
Reset All Settings
Resetting all settings on your iPhone or iPad resolves issues caused by conflicting settings. If Xcode Instruments continues to display high activity, open the Settings app and select General > Transfer or Reset iPhone > Reset > Reset All Settings.
If that doesn’t do anything, the next logical step is to erase and reset your iPhone or iPad to factory defaults.
Inner Workings
Xcode provides a great window into the list of processes that make your iPhone or iPad work and even helps with troubleshooting. Admittedly, setting up the IDE on your Mac is time-consuming and requires a substantial chunk of disk space. But if you have the patience and the storage to spare, it can be a surprisingly fun exercise.