A Swift-based service for creating and signing iOS configuration profiles.
Create a .env
file in the root directory with the following variables:
CERTIFICATE_PATH=Certificates/profile_creator.p12
CERTIFICATE_PASSWORD=development
For development purposes, you can create a self-signed certificate using the provided script:
# Make the script executable
chmod +x Scripts/create_profile_certificate.sh
# Run the script
./Scripts/create_profile_certificate.sh
This will create a development certificate at Certificates/profile_creator.p12
with the password "development".
For production use, you'll need to obtain a proper certificate from Apple. You can do this through:
- Apple Developer Program (https://developer.apple.com)
- Apple Business Manager (https://business.apple.com)
- Apple School Manager (https://school.apple.com)
Once you have your production certificate:
- Convert it to PKCS12 format if it isn't already
- Place it in the
Certificates
directory - Update the
CERTIFICATE_PATH
andCERTIFICATE_PASSWORD
in your.env
file
swift run
The service will start on http://localhost:8080
.
Use curl to upload a mobile configuration file:
curl -X POST -F "file=@Resources/test.mobileconfig" http://localhost:8080/api/mobileconfig/upload
The response will include a download URL:
{
"status": "success",
"download_url": "/uploads/UUID.mobileconfig"
}
-
Make sure your iOS device is on the same network as the server
-
Find your computer's local IP address:
ipconfig getifaddr en0 # On macOS
-
Construct the full URL using your computer's IP:
http://YOUR_IP:8080/uploads/UUID.mobileconfig
For example:
http://192.168.1.100:8080/uploads/UUID.mobileconfig
-
Open this URL in Safari on your iOS device
-
Follow the prompts to install the profile
- If you get a "port in use" error, find and kill the existing process:
lsof -i :8080 kill <PID>
- If the profile fails to install, check the server logs for signing errors
- Make sure your iOS device can reach the server's IP address on port 8080