Windows 10 使用 VirtualBox 创建的 Monterey 12.6.7 macOS 虚拟机不能识别到 iPhone 7 手机。
iPhone 7 已经连接到电脑主机 (win 10) 的 USB 3.0 口子,手机已经信任电脑。
在 win 10,我看到了 “此电脑\Apple iPhone”,就是说,宿主机识别到了 手机。
现在,开启macOS 虚拟机,虚拟机右下角的 usb 图标,显示并且勾选到了 "Apple Inc. iPhone [0901]",但虚拟机还是没看到手机设备,导致 Xcode 也看不到手机设备。
虚拟机运行后,插拔 iPhone 7 手机,通过
sudo log show --predicate 'eventMessage contains "usbmuxd"' --info
看到了报错信息:
2025-02-13 10:31:06.541201+0800 0xa3c Error 0x0 0 0 kernel: (Sandbox) 1 duplicate report for System Policy: usbmuxd(22583) deny(1) file-write-mode /private/var/db/lockdown
2025-02-13 10:31:07.090321+0800 0xf807 Error 0x0 140 0 sandboxd: [com.apple.sandbox.reporting:violation] System Policy: usbmuxd(22583) deny(1) file-write-mode /private/var/db/lockdown
Violation: deny(1) file-write-mode /private/var/db/lockdown
Process: usbmuxd [22583]
Path: /usr/local/sbin/usbmuxd
Load Address: 0x10564b000
Identifier: usbmuxd
Version: ??? (???)
Code Type: x86_64 (Native)
Parent Process: sudo [22582]
Responsible: /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
User ID: 0
Date/Time: 2025-02-13 10:31:06.793 GMT+8
OS Version: macOS 12.6.7 (21G651)
Release Type: User
Report Version: 8
MetaData: {"vnode-type":"DIRECTORY","hardlinked":false,"pid":22583,"process":"usbmuxd","primary-filter-value":"/private/var/db/lockdown","platform-policy":true,"binary-in-trust-cache":false,"path":"/private/var/db/lockdown","primary-filter":"path","action":"deny","matched-extension":false,"process-path":"/usr/local/sbin/usbmuxd","file-flags":0,"responsible-process-path":"/System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal","flags":21,"platform-binary":false,"rdev":0,"summary":"deny(1) file-write-mode /private/var/db/lockdown","target":"/private/var/db/lockdown","mount-flags":76582912,"profile":"platform","matched-user-intent-extension":false,"apple-internal":false,"storage-class":"Lockdown","platform_binary":"no","operation":"file-write-mode","profile-flags":0,"normalized_target":["private","var","db","lockdown"],"file-mode":448,"errno":1,"build":"macOS 12.6.7 (21G651)","policy-description":"System Policy","responsible-process-signing-id":"com.apple.Terminal","hardware":"Mac","uid":0,"release-type":"User"}
Thread 0 (id: 63477):
0 libsystem_kernel.dylib 0x00007ff80d8368ae __chmod + 10
1 usbmuxd 0x000000010565584e main + 3582 (main.c:816)
2 dyld 0x0000000114e3f52e start + 462
Binary Images:
0x10564b000 - 0x10565afff usbmuxd (0) <0fc9b657-d311-38b5-bf02-e294b175a615> /usr/local/sbin/usbmuxd
0x114e3a000 - 0x114ea3567 dyld (960) <2517e9fe-884a-3855-8532-92bffba3f81c> /usr/lib/dyld
0x7ff80d832000 - 0x7ff80d869fff libsystem_kernel.dylib (8020.240.18.701.6) /usr/lib/system/libsystem_kernel.dylib
2025-02-13 10:35:39.751714+0800 0x27f Default 0x0 0 0 kernel: (Sandbox) Sandbox: usbmuxd(119) allow iokit-get-properties kCDCDoNotMatchThisDevice
2025-02-13 10:35:45.025063+0800 0x27f Default 0x0 0 0 kernel: (Sandbox) Sandbox: usbmuxd(119) allow iokit-get-properties kCDCDoNotMatchThisDevice
General
RSS for tagDive into the vast array of tools and services available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In our Unity App for iOS build, when we opened the PDF from the app, it is automatically opening in landspace mode instead of portrait. In the android and windows apps, we are able to open in the portrait mode. We tried to make the changes in the project settings but it did not change.
Any way in which we can acheive this would be helpful for us.
Hi, I requested the https://itunes.apple.com/lookup?id=6482849843&country=us for getting the information of Goods puzzle sort challange , but the screenshotUrls in the response was empty. Is iTunes search API has issue with getting the screenshot urls ? Is there any plan to update it ?
Topic:
Developer Tools & Services
SubTopic:
General
I regularly bump into folks confused by this issue, so I thought I’d collect my thoughts on the topic into a single (hopefully) coherent post.
If you have questions or comments, put them in a new thread here on the forums. Feel free to use whatever subtopic and tags that apply to your situation, but make sure to add the Debugging tag so that I see your thread go by.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Testing and Debugging Code Running in the Background
I regularly see questions like this:
My background code works just fine in Xcode but fails when I download the app from the App Store.
or this:
… or fails when I run my app from the Home screen.
or this:
How do I step through my background code?
These suggest a fundamental misunderstanding of how the debugger interacts with iOS’s background execution model. The goal of this post is to explain that misunderstanding so that you can effectively test and debug background code.
Note The focus of this post is iOS. The advice here generally applies to any of iOS’s ‘child’ platforms, so iPadOS, tvOS, and so on. However, there will be some platform specific differences, especially on watchOS. This advice here doesn’t apply to macOS. It’s background execution model is completely different than the one used by iOS.
Understand the Fundamentals
The key point to note here is that the debugger prevents your app from suspending. This has important consequences for iOS’s background execution model. Normally:
iOS suspends your app when it’s in the background.
Once your app is suspended, it becomes eligible for termination. The most common reason for this is that the system wants to recover memory, but it can happen for various other reasons. For example, the system might terminate a suspended app in order to update it.
Under various circumstances your app can continue running after moving to the background. A great example of this is the continued processed task feature, introduced in iOS 26 beta.
Alternatively, your app can be resumed or relaunched in the background to perform some task. For example, the region monitor feature of Core Location can resume or relaunch your app in the background when the user enters or leaves a region.
If no app needs to be executing, the system can sleep the CPU.
None of this happens in the normal way if the debugger is attached to your app, and it’s vital that you take that into account when debugging code that runs in the background.
An Example of the Problem
For an example of how this can cause problems, imagine an app that uses an URLSession background session. A background session will resume or relaunch your app in the background when specific events happen. This involves two separate code paths:
If your app is suspended, the session resumes it in the background.
If your app is terminated, it relaunches it in the background.
Neither code path behaves normally if the debugger is attached. In the first case, the app never suspends, so the resume case isn’t properly exercised. Rather, your background session acts like it would if your app were in the foreground. Normally this doesn’t cause too many problems, so this isn’t a huge concern.
On the other hand, the second case is much more problematic. The debugger prevents your app from suspending, and hence from terminating, and thus you can’t exercise this code path at all.
Seek Framework-Specific Advice
The above is just an example, and there are likely other things to keep in mind when debugging background code for a specific framework. Consult the documentation for the framework you’re working with to see if it has specific advice.
Note For URLSession background sessions, check out Testing Background Session Code.
The rest of this post focuses on the general case, offering advice that applies to all frameworks that support background execution.
Run Your App Outside of Xcode
When debugging background execution, launch your app from the Home screen. For day-to-day development:
Run the app from Xcode in the normal way (Product > Run).
Stop it.
Run it again from the Home screen.
Alternatively, install a build from TestFlight. This accurately replicates the App Store install experience.
Write Code with Debugging in Mind
It’s obvious that, if you run the app without attaching the debugger, you won’t be able to use the debugger to debug it. Rather:
Extract the core logic of your code into libraries, and then write extensive unit tests for those libraries. You’ll be able to debug these unit tests with the debugger.
Add log points to help debug your integration with the system.
Treat your logging as a feature of your product. Carefully consider where to add log points and at what level to log. Check this logging code into your source code repository and ship it — or at least the bulk of it — as part of your final product. This logging will be super helpful when it comes to debugging problems that only show up in the field.
My general advice is that you use the system log for these log points. See Your Friend the System Log for lots of advice on that front.
One of the great features of the system log is that disabled log points are very cheap. In most cases it’s fine to leave these in your final product.
Attach and Detach
In some cases it really is helpful to debug with the debugger. One option here is to attach to your running app, debug a specific thing, and then detach from it. Specifically:
To attach to a running app, choose Debug > Attach to Process > YourAppName in Xcode.
To detach, choose Debug > Detach.
Understand Force Quit
iOS allows users to remove an app from the multitasking UI. This is commonly known as force quit, but that’s not a particularly accurate term:
The multitasking UI doesn’t show apps that are running, it shows apps that have been run by the user. The UI shows recently run apps regardless of whether they’re in the foreground, running in the background, suspended, or terminated. So, removing an app from the UI may not actually quit anything.
Removing an app sets a flag that prevents the app from being launched in the background. That flag gets cleared when the user next launches the app manually.
Note In some circumstances iOS will not honour this flag. The exact cases where this happens are not documented and have changed over time.
Keep these behaviours in mind as you debug your background execution code. For example, imagine you’re trying to test the URLSession background relaunch code path discussed above. If you force quit your app, you’ll never hit this code path because iOS won’t relaunch your app in the background. Rather, add a debug-only button that causes your app to call exit.
IMPORTANT This suggestion is for debugging only. Don’t include a Quit button in your final app! This is specifically proscribed by QA1561.
Alternatively, if you’re attached to your app with Xcode, simply choose Product > Stop. This is like calling exit; it has no impact on your app’s ability to run in the background.
Test With Various Background App Refresh Settings
iOS puts users in control of background execution via the options in Settings > General > Background App Refresh. Test how your app performs with the following settings:
Background app refresh turned off overall
Background app refresh turned on in general but turned off for your app
Background app refresh turned on in general and turned on for your app
IMPORTANT While these settings are labelled Background App Refresh, they affect subsystems other than background app refresh. Test all of these cases regardless of what specific background execution feature you’re using.
Test Realistic User Scenarios
In many cases you won’t be able to fully test background execution code at your desk. Rather, install a TestFlight build of your app and then use the device as a normal user would. For example:
To test Core Location background execution properly, actual leave your office and move around as a user might.
To test background app refresh, use your app regularly during the day and then put your device on charge at night.
Testing like this requires two things:
Patience
Good logging
The system log may be sufficient here, but you might need to investigate other logging solutions that are more appropriate for your product.
These testing challenges are why it’s critical that you have unit tests to exercise your core logic. It takes a lot of time to run integration tests like this, so you want to focus on integration issues. Before starting your integration tests, make sure that your unit tests have flushed out any bugs in your core logic.
Revision History
2025-08-12 Made various editorial changes.
2025-08-11 First posted.
Hey, I am using the terminal a lot. Since I updated to Sonoma (so, really a long time ago). My prompt or more precise the hostname always changes between three states. Sometimes it is username@Macbook-Pro-of-***, sometimes username@MacbookPro and sometimes it's username@xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb. The latter is probably my UUID. Does anyone have a clue why this randomly changes?
I am running Appium tests on an iOS 18 simulator, and I am encountering an intermittent issue where the device screen gets locked unexpectedly during the tests. The Appium logs show no errors or unusual activity, and all commands appear to be executed successfully.
However, upon reviewing the device logs, I see entries related to the lock event, but the exact cause remains unclear.
SpringBoard: (SpringBoard) [com.apple.SpringBoard:Common] lockUIFromSource:Boot options:{
SBUILockOptionsLockAutomaticallyKey: 1,
SBUILockOptionsForceLockKey: 1,
SBUILockOptionsUseScreenOffModeKey: 0
}
SpringBoard: (SpringBoard) [com.apple.SpringBoard:Common] -[SBTelephonyManager inCall] 0
SpringBoard: (SpringBoard) [com.apple.SpringBoard:Common] LockUI from source: Now locking
Has anyone experienced similar behavior with Appium on iOS 18, or could there be a setting or configuration in the simulator that is causing this issue?
We have noticed that the hang reports provided in Xcode include the percentage of hang time, which are used to sort from high to low (effectively sorting by priority).
However when adding these percentages up we do not get 100%. For newer releases the total may be quite low (5-20%) but even for older releases we only get up to around 85%.
Are there reports we are missing? Is there a threshold or something that lower percentage reports are not hitting?
Any level of understanding here would be appreciated!
Hi all.
I'm developing a homekit accessory, and I'm currently doing mfi certification.
The developed product is smart door lock and supports homekey.
Use below tools
iPhone 13 , XR , 11
HomeKit Certification Assistant 6.4.0
HomeKit Accessory Tester 9.3.0
HomeKit Companion 2.4.3
I recently updated my iPhone 11 to iOS 18.1
and if I proceed with TCL0029 of HCA, there is a problem.
Companion has no response to "SELECT step-up AID".
(Unified Access Air Protocol Specification R1.1.pdf)
The companion outputs the following message.
"Step-up Encountered Error"
There is no problem with iOS 17.x.
Products that have already been certified are experiencing the same symptoms.
There is no problem with using homekey in real life, only problem with companion.
About technotes
Technotes are focused, timely documents from Apple Developer Technical Support. They explore a wide range of development topics and provide guidance for developers creating apps and accessories for all of Apple’s platforms. Learn about specific development topics through these in-depth technical articles. You can subscribe to this RSS feed to get notified when new technotes are published.
We encourage you to discuss the technotes here in the forums and share your feedback via Feedback Assistant. Let us know if a technote is helpful, or what we can do to improve it. We would appreciate it if you include a Feedback Assistant (FB) number in your forums post, so we can easily track your feedback, and let you know when it’s resolved.
Tagging your post
When tagging your post, please add the relevant tags for the technology area it applies to. You can also add the Technotes tag, if you wish.
Providing feedback
To create new feedback about a specific technote (or technotes as a whole) using Feedback Assistant, use the following path:
What are you seeing an issue with? Developer Tools
Which area are you seeing an issue with? Developer Documentation
What does the documentation issue you are reporting involve? Technotes
Please provide the URL of the content you reporting an issue with: The complete URL of the technote. For example, https://developer.apple.com/documentation/technotes/tn3102-http3-in-your-app.
If you wish to leave feedback on Technotes in general, use https://developer.apple.com/documentation/technotes for the URL.
Then complete the remaining fields appropriately.
We appreciate and look forward to your feedback.
Title basically explains what my issue is, from what I understand the only way to set an icon in an tauri app is using a icns file, I could be wrong but I don't know how to get macos theme changing stuff to work with it because of the icns file.
Topic:
Developer Tools & Services
SubTopic:
General
When a user subscribes I create a document in Firestore to track that subscription using my back end. In sandbox it works perfect, one document made for each purchase. When a real user subscribes I get 5 slightly different transaction ID’s (last 4 digits change). Is this just an Apple thing and I should keep all 5? I need them for webhooks to track
Check the status here
https://developer.apple.com/system-status/
This prevents use of App Store Connect, XCode accounts, TestFlight, app submissions etc.
no need to post about every individual problem ;)
Topic:
Developer Tools & Services
SubTopic:
General
I am running into an issue where when layers are grouped, the icon is not shown as it does within the preview in the Icon Composer app
Is this a bug or is it some setting within the group/app?
There is a bug in Unity Plugins: Corehaptics.AssetPickerDrawer throws exceptions and draws incorrectly when fieldInfo or assetType is null (FB17305973). I fixed it and created a pull request: https://github.com/apple/unityplugins/pull/47
It has been months and this bug is really annoying.
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Prototyping
Core Haptics
Apple Unity Plug-Ins
Hi,
I'm generating MusicKit JWT tokens on my backend side and using it on the client side to query the Apple Music API. One concern I have is accidentally over issuing the scope of this JWT, resulting in accidental access more services than intended like DeviceCheck or APNS.
Other than using separate keys for MusicKit and other services, is there a way to limit the generated JWT to only the Apple Music API (https://api.music.apple.com/v1/*) using the JWT payload scope?
Topic:
Developer Tools & Services
SubTopic:
General
Tags:
Apple Music API
MusicKit
App Store Connect API
Why as an IDE, many developers want to use the functions are not available, such as code formatting, if the function is not available, why not even a plug-in center, I have been using IDEA for code development, with Xcode development, feel very inconvenient to use
Saw this info: https://developer.apple.com/documentation/contacts/cncontactstore
But have no idea what I'm doing. This is a pressing matter and I need to determine the date/time contacts were originally created on my icloud account. I have tried the shortcuts method and it merely shows the date they were loaded into whichever device i'm logged in on if they were created a while ago
I work at a well-established university with a business journal that is over 25 years old. We have been waiting now for almost four months to have our Apple News account reviewed. In what world is this OK? No ability to communicate with anyone or have any updates except to log in once a month to see the 'under review' message still there. Seriously?
Hi!
Do the consoles in the App Store Connect differ by country?
In particular, there are mentions on the Internet that in China the publisher can make refunds to users, but there is no such function in the American account.
Topic:
Developer Tools & Services
SubTopic:
General
Hi
Would someone happen to know how to solve the problem when installing Concorde.jl in julia:
(@v1.11) pkg> add Concorde
Resolving package versions...
No Changes to ~/.julia/environments/v1.11/Project.toml
No Changes to ~/.julia/environments/v1.11/Manifest.toml
Precompiling project...
✗ Concorde
0 dependencies successfully precompiled in 2 seconds. 238 already precompiled.
1 dependency errored.
For a report of the errors see julia> err. To retry use pkg> precompile
(@v1.11) pkg> build Concorde
Building Concorde → ~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/5d9f1b1a480235ffdd3c8ab8cab011aa9afe81af/build.log
ERROR: Error building Concorde, showing the last 100 of log:
x ./concorde/TOOLS/prob2tsp.c
x ./concorde/TOOLS/showres.c
...
x ./concorde/VERIFY/Makefile.in
x ./concorde/README
loading cache ./config.cache
checking host system type... Invalid configuration darwin': machine darwin' not recognized
checking for prespecified compiler options... no
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -fPIC -O2 -g ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
ERROR: LoadError: failed process: Process(bash -c "CFLAGS='-fPIC -O2 -g' ./configure --with-qsopt=/Users/poss/.julia/packages/Concorde/VRfqN/deps/qsopt --host=darwin", ProcessExited(1)) [1]
It seems to be related to the M3 processor as I have the same error on another Mac with that processor, while the M2 I tried on could install the package properly.
It is related to my C compiler, but the latter works, despite the error "checking whether the C compiler (gcc -fPIC -O2 -g ) works... no"
poss@Mac-de-Michael ~ % gcc --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
poss@Mac-de-Michael ~ % gcc -fPIC -O2 -g test.c
Best,
Michaël.
Topic:
Developer Tools & Services
SubTopic:
General