No such module 'DeviceManagement'

I'm working on the companion iOS app for my purpose-built MDM system. when I use the following in a .swift file:

import DeviceManagement

I get the build issue: No such module 'DeviceManagement'

When I attempt to add the framework in the Frameworks, Libraries, and Embedded Content settings, DeviceManagement doesn't even show up in the available frameworks.

Alll the documentation I can find suggests that is the correct framework to import, but I'm new to this and not sure if I'm just missing something.

Some AI help is suggesting that the culprit might be v16.x of Xcode, but I don't know enough to prove that correct or not.

Any ideas on why Xcode believes there is no such module? Is there documentation that might help me learn how to make that framework available for my project?

Answered by DTS Engineer in 841445022

Thans for the clarification.

Since the DDM can't change the configuration on it's own

Indeed. But wouldn’t it be cool if it could? (-: I think it’d be reasonable for you to file an enhancement request against DDM asking for this feature. And if you do that, please post your bug number, just for the record.

I was trying to wake up the app, and have the app update the declaration, then report back to the server on the current state of the device.

That might be feasible, but I see a number of potential challenges:

  • I don’t think you’ll be able to update the declaration directly from the app. But you could have the app communicate with a web service to do it on the app’s behalf.

  • Normally I’d recommend that you set up a custom web service for this, but if you’re building your own MDM then you could just have it expose a new endpoint for this.

  • Historically the biggest challenge with this sort of thing was authentication, but ManagedApp framework makes that so much easier.

  • There’s also a location services aspect to this. Historically this approach might fail if the user ‘force quit’ your app (that is, removed it from the multitasking UI by swiping up). I’m not 100% sure of the current state there, but ISTR it’s improved. But location isn’t really my forte, so if you have questions on that front I encourage you start a new thread in the App & System Services > Maps & Location topic area.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I get the build issue: No such module 'DeviceManagement'

Right. That’s because DeviceManagement isn’t actually a framework. Rather, it’s a container in which you’ll find documentation for a number of other technologies. See Device Management.

I'm working on the companion iOS app for my purpose-built MDM system.

What sort of functionality are you trying to achieve? Knowing that will help me guide you in the right direction. For example, if you want to make HTTP requests to your MDM server infrastructure, you would do that using the same URLSession API that every other iOS app uses.

The one framework that springs to mind for MDM app developers specifically is ManagedAppDistribution.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Ahh ok. thank you. there was a WWDC intro to DDM that gave me the idea it was a framework.

The goal of the system is to disable the camera inside defined geofences. My understanding is that with DDM I could have the enforcement happen on the device and report back to the server, instead of the standard MDM mechanism of tapping the server to deliver a new configuration. Since the DDM can't change the configuration on it's own, I was trying to wake up the app, and have the app update the declaration, then report back to the server on the current state of the device.

Thans for the clarification.

Since the DDM can't change the configuration on it's own

Indeed. But wouldn’t it be cool if it could? (-: I think it’d be reasonable for you to file an enhancement request against DDM asking for this feature. And if you do that, please post your bug number, just for the record.

I was trying to wake up the app, and have the app update the declaration, then report back to the server on the current state of the device.

That might be feasible, but I see a number of potential challenges:

  • I don’t think you’ll be able to update the declaration directly from the app. But you could have the app communicate with a web service to do it on the app’s behalf.

  • Normally I’d recommend that you set up a custom web service for this, but if you’re building your own MDM then you could just have it expose a new endpoint for this.

  • Historically the biggest challenge with this sort of thing was authentication, but ManagedApp framework makes that so much easier.

  • There’s also a location services aspect to this. Historically this approach might fail if the user ‘force quit’ your app (that is, removed it from the multitasking UI by swiping up). I’m not 100% sure of the current state there, but ISTR it’s improved. But location isn’t really my forte, so if you have questions on that front I encourage you start a new thread in the App & System Services > Maps & Location topic area.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

No such module 'DeviceManagement'
 
 
Q