Browse Source

readme: updated with more information

pull/2563/head
osy 4 years ago
parent
commit
09d187915b
  1. 36
      CodeSigning.xcconfig.sample
  2. 17
      Documentation/MacDevelopment.md
  3. 15
      Documentation/iOSDevelopment.md

36
CodeSigning.xcconfig.sample

@ -1,2 +1,38 @@
// Your Team ID. See `Documentation/iOSDevelopment.md` for help finding this.
DEVELOPMENT_TEAM = XYZ0123456
// Prefix of unique bundle IDs registered to you in Apple Developer Portal.
// You need to register:
// - com.myuniquename.UTM
// - com.myuniquename.QEMUHelper
// - com.myuniquename.QEMULauncher
PRODUCT_BUNDLE_PREFIX = com.myuniquename
// Name of the iOS development signing certificate, you probably do not need
// to change this.
CODE_SIGN_IDENTITY_IOS = Apple Development
// The values below are specific to macOS development. If you do not define
// these keys, the build will default to ad-hoc signing. You will need to
// follow `Documentation/MacDevelopment.md` to disable library verification and
// remove unsupported entitlements.
// Name of the macOS development signing certificate. Comment out this line to
// use ad-hoc signing.
CODE_SIGN_IDENTITY_MAC = Apple Development
// Create a Mac provisioning profile for com.myuniquename.UTM with the
// Hypervisor entitlements and get its UUID. If you do not have access to these
// entitlements, comment out the line and delete the following entitlements
// - com.apple.vm.device-access
// from the following file
// - Platform/macOS/macOS.entitlements
PROVISIONING_PROFILE_SPECIFIER_MAC = 00000000-1111-2222-3333-444444444444
// Create a Mac provisioning profile for com.myuniquename.QEMUHelper with the
// Hypervisor entitlements and get its UUID. If you do not have access to these
// entitlements, comment out the line and delete the following entitlements
// - com.apple.vm.networking
// from the following file
// - QEMUHelper/QEMUHelper.entitlements
PROVISIONING_PROFILE_SPECIFIER_HELPER = 00000000-1111-2222-3333-555555555555

17
Documentation/MacDevelopment.md

@ -61,31 +61,32 @@ This builds `UTM.dmg` in `/path/to/output` which can be installed to `/Applicati
#### Signed packages
```
./scripts/package_mac.sh developer-id /path/to/UTM.xcarchive /path/to/output TEAM_ID PROFILE_UUID
./scripts/package_mac.sh developer-id /path/to/UTM.xcarchive /path/to/output TEAM_ID PROFILE_UUID HELPER_PROFILE_UUID
```
To build a signed package, you need to be a registered Apple Developer. From the developer portal, create a certificate for "Developer ID Application" (and install it into your Keychain). Also create a provisioning profile with that certificate with Hypervisor entitlements (you need to manually request these entitlements and be approved by Apple). `TEAM_ID` should be the same as in the certificate and `PROFILE_UUID` should be the UUID of the profile installed by Xcode (open the profile in Xcode).
To build a signed package, you need to be a registered Apple Developer. From the developer portal, create a certificate for "Developer ID Application" (and install it into your Keychain). Also create two provisioning profiles with that certificate with Hypervisor entitlements (you need to manually request these entitlements and be approved by Apple) for both UTM and QEMUHelper. `TEAM_ID` should be the same as in the certificate, `PROFILE_UUID` should be the UUID of the profile installed by Xcode (open the profile in Xcode), and `HELPER_PROFILE_UUID` is the UUID of a separate profile for the XPC helper.
Once properly signed, you can ask Apple to notarize the DMG.
#### Mac App Store
```
./scripts/package_mac.sh app-store /path/to/UTM.xcarchive /path/to/output TEAM_ID PROFILE_UUID
./scripts/package_mac.sh app-store /path/to/UTM.xcarchive /path/to/output TEAM_ID PROFILE_UUID HELPER_PROFILE_UUID
```
Similar to the above but builds a `UTM.pkg` for submission to the Mac App Store. You need a certificate for "Apple Distribution" and a certificate for "Mac App Distribution" as well as a provisioning profile with the right entitlements.
### Xcode Development
To build the Xcode project without a registered developer account, you will need to disable USB support.
To build the Xcode project without a registered developer account, you will need to disable USB and bridged networking support.
1. Open `Platform/macOS/macOS.entitlements` and delete the entry for `com.apple.vm.device-access`.
2. In the project settings, select the "macOS" target and go to the "Signing & Capabilities" tab and check the box for "Disable Library Validation".
3. Repeat for the "QEMUHelper" target.
4. Repeat for the "QEMULauncher" target.
2. Open `QEMUHelper/QEMUHelper.entitlements` and delete the entry for `com.apple.vm.networking`.
3. In the project settings, select the "macOS" target and go to the "Signing & Capabilities" tab and check the box for "Disable Library Validation".
4. Repeat for the "QEMUHelper" target.
5. Repeat for the "QEMULauncher" target.
You should now be able to run and debug UTM. If you have a registered developer account with access to Hypervisor entitlements, you can (for all three targets) select your Team and "Development" Signing Certificate from the "Signing & Capabilities" tab.
You should now be able to run and debug UTM. If you have a registered developer account with access to Hypervisor entitlements, you should create a `CodeSigning.xcconfig` file with the proper values (see `CodeSigning.xcconfig.sample`). Otherwise, the build will default to ad-hoc signing.
Note that due to a macOS bug, you may get a crash when launching a VM with the debugger attached. The workaround is to start UTM with the debugger detached and attach the debugger with Debug -> Attach to Process after launching a VM. Once you do that, you can start additional VMs without any issues with the debugger.

15
Documentation/iOSDevelopment.md

@ -13,7 +13,14 @@ Alternatively, run `git submodule update --init --recursive` after cloning if yo
## Dependencies
The easy way is to get the prebuilt dependences from [Github Actions][1]. Pick the latest release and download all of the `Sysroot-iOS-*` artifacts. You need to be logged in to Github to download artifacts. If you want to run on a real iOS device, get the `arm64` variant. If you want to run on iOS simulator for Intel Mac, get the `x86_64` variant. At this time, there is no pre-built for iOS simulator for M1 Macs.
The easy way is to get the prebuilt dependences from [Github Actions][1]. Pick the latest release and download the `Sysroot-*` artifact for the targets you wish to develop on. You need to be logged in to Github to download artifacts.
| | Intel | Apple Silicon |
|--------------|----------------------------|---------------------------|
| iOS | N/A | `ios-arm64` |
| iOS SE | N/A | `ios-tci-arm64` |
| Simulator | `ios_simulator-x86_64` | `ios_simulator-arm64` |
| Simulator SE | `ios_simulator-tci-x86_64` | `ios_simulator-tci-arm64` |
### Building Dependencies (Advanced)
@ -24,8 +31,8 @@ If you want to build the dependencies yourself, it is highly recommended that yo
`brew install bison pkg-config gettext glib libgpg-error nasm make meson`
Make sure to add `bison` and `gettext` to your `$PATH` environment variable!
`export PATH=/usr/local/opt/bison/bin:/usr/local/opt/gettext/bin:$PATH`
3. Run `./scripts/build_dependencies.sh -p ios -a arm64` for iOS devices.
4. (Intel Macs only) Run `./scripts/build_dependencies.sh -p ios -a x86_64` for iOS simulator.
3. Run `./scripts/build_dependencies.sh -p PLATFORM -a ARCHITECTURE` where `ARCHITECTURE` is the last part of the table above (e.g. `x86_64`) and `PLATFORM` is the first part (e.g. `ios_simulator-tci`).
4. Repeat the above for any other platforms and architectures you wish to target.
## Building UTM
@ -37,7 +44,7 @@ You can build UTM with the script:
./scripts/build_utm.sh -p ios -a arm64 -o /path/to/output/directory
```
The built artifact is an unsigned `.xcarchive` which you can use with the package tool (see below).
The built artifact is an unsigned `.xcarchive` which you can use with the package tool (see below). Replace `ios` with `ios-tci` to build UTM SE.
### Packaging

Loading…
Cancel
Save