Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apple] Issues installing simulators #1045

Open
mattleibow opened this issue Jul 5, 2023 · 5 comments
Open

[apple] Issues installing simulators #1045

mattleibow opened this issue Jul 5, 2023 · 5 comments
Labels
apple iOS/tvOS/WatchOS/Mac Catalyst area emulator Related to an emulator/Simulator

Comments

@mattleibow
Copy link
Member

xharness apple simulators install com.apple.pkg.iPhoneSimulatorSDK15_5 -v

The download first always retries:

info: The simulator 'iOS 15.5 Simulator' is missing and will be installed
info: Installing 'iOS 15.5 Simulator' (15.5.1.1653527639)...
info: Downloading 'https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg' to '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg' because the existing file's size 5415504705 does not match the expected size 5430783739...

But if I download myself and edit the xml file to say it is the size it is:

info: The simulator 'iOS 15.5 Simulator' is missing and will be installed
info: Installing 'iOS 15.5 Simulator' (15.5.1.1653527639)...
info: Mounting '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg' into '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg-mount'...
dbug: 
      
dbug: Running hdiutil attach /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg -mountpoint /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg-mount -quiet -nobrowse
      
dbug: Process hdiutil exited with 0
      
info: Expanding '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg-mount/iPhoneSimulatorSDK15_5.pkg' into '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer-expanded-pkg'...
dbug: 
      
dbug: Running pkgutil --expand /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg-mount/iPhoneSimulatorSDK15_5.pkg /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer-expanded-pkg
      
dbug: Process pkgutil exited with 0
      
info: Creating fixed package '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg' from '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer-expanded-pkg'...
dbug: 
      
dbug: Running pkgutil --flatten /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer-expanded-pkg /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg
      
dbug: Process pkgutil exited with 0
      
info: Installing '/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg'...
dbug: 
      
dbug: Running sudo installer -pkg /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg -target / -verbose -dumplog
      
dbug: Process sudo exited with 1

     
dbug: Error output:
      Jul  6 01:15:22  installer[41620] <Debug>: Referenced component packages (1) trustLevel=100
      Jul  6 01:15:22  installer[41620] <Debug>: -[IFPKGDerivedDocument sortedPackageLocations]: result = (
      	    "file://localhost"
      	)
      Jul  6 01:15:22  installer[41620] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: location = file://localhost
      Jul  6 01:15:22  installer[41620] <Debug>: -[IFDInstallController(Private) _buildInstallPlanReturningError:]: file://localhost/private/var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg
      Jul  6 01:15:22  installer[41620] <Info>: Set authorization level to root for session
      Jul  6 01:15:22  installer[41620] <Info>: Authorization is being checked, waiting until authorization arrives.
      Jul  6 01:15:22  installer[41620] <Info>: Administrator authorization granted.
      Jul  6 01:15:22  installer[41620] <Info>: Packages have been authorized for installation.
      Jul  6 01:15:22  installer[41620] <Debug>: Will use PK session
      Jul  6 01:15:22  installer[41620] <Debug>: Using authorization level of root for IFPKInstallElement
      Jul  6 01:16:01  installer[41620] <Info>: Starting installation:
      Jul  6 01:16:01  installer[41620] <Notice>: Configuring volume "Macintosh HD"
      Jul  6 01:16:01  installer[41620] <Info>: Preparing disk for local booted install.
      Jul  6 01:16:01  installer[41620] <Notice>: Free space on "Macintosh HD": 695.64 GB (695642796032 bytes).
      Jul  6 01:16:01  installer[41620] <Notice>: Create temporary directory "/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T//Install.41620ZYFiLs"
      Jul  6 01:16:01  installer[41620] <Notice>: IFPKInstallElement (1 packages)
      Jul  6 01:16:01  installer[41620] <Info>: Current Path: /usr/sbin/installer
      Jul  6 01:16:01  installer[41620] <Info>: Current Path: /usr/bin/sudo
      Jul  6 01:16:01  installer[41620] <Notice>: PackageKit: Enqueuing install with framework-specified quality of service (utility)
      Jul  6 01:20:20  installer[41620] <Debug>: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=120 "An unexpected error occurred while moving files to the final destination." UserInfo={NSUnderlyingError=0x600003a9c1b0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}, NSLocalizedDescription=An unexpected error occurred while moving files to the final destination., arguments=(
      	    "-f",
      	    "-s",
      	    "/Library/InstallerSandboxes/.PKInstallSandboxManager/F12AFE79-1393-482F-9EA5-A2C44DD2EDD4.activeSandbox/Root",
      	    "/"
      	)}
      Jul  6 01:20:21  installer[41620] <Error>: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
      
fail: Failed to install package:
      installer: Package name is com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed
      installer: Installing at base path /
      installer: Preparing for installation….....
      installer: Preparing the disk….....
      installer: Preparing com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed….....
      installer: Waiting for other installations to complete….....
      installer: Configuring the installation….....
      installer: 	
      #
      installer: Validating packages….....
      installer: Validating packages….....
      #
      installer: Writing files….....
      installer: Writing files….....

      #
      installer: Writing files….....
      #
      installer: Moving items into place….....
      installer: Validating packages….....
      #
      installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. An unexpected error occurred while moving files to the final destination.)
      
dbug: 
      
dbug: Running hdiutil detach /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639.dmg-mount -quiet
      
dbug: Process hdiutil exited with 0
      
fail: Failed to install 'iOS 15.5 Simulator'
@mattleibow
Copy link
Member Author

I ran the install manually and this is the error... Maybe it is my M1?

Screenshot 2023-07-06 at 1 28 57 AM

@premun
Copy link
Member

premun commented Jul 7, 2023

@mattleibow I see all the simulator installation issues and I cannot be of much help unfortunately. This functionality has been ported over from Xamarin but we've never exercised these commands in our flows - we only use the default iOS version that comes with each Xcode. So I cannot offer more advice in this area. Maybe Rolf has more experience with this.

@premun premun added apple iOS/tvOS/WatchOS/Mac Catalyst area emulator Related to an emulator/Simulator labels Jul 7, 2023
@akoeplinger
Copy link
Member

akoeplinger commented Jul 11, 2023

@mattleibow I think running the installer manually won't work since it looks like the .pkg does have an install location of / (which I assume causes the "trying to install content to the system volume") and we have special code in xharness to fix that:

// According to the package manifest, the package's install location is /.
// That's obviously not where it's installed, but I have no idea how Apple does it
// So instead decompress the package, modify the package manifest, re-create the package, and then install it.


Not sure what happened in your case but the "An unexpected error occurred while moving files to the final destination." looks basically the same as #840 and afaik it only happened on MAUI machines and we couldn't really figure out the cause back then.

@mattleibow
Copy link
Member Author

I was testing on a cleanish macbook... Not sure if there is more logs to get to help? Or is this basically a case of me just needing to wipe it all and start over?

@akoeplinger
Copy link
Member

@mattleibow does it reproduce all the time? you should be able to try manually installing the "fixed" package at /var/folders/x1/2s1cq4312cx35w541x8d45mm0000gn/T/simulator-installer/com.apple.pkg.iPhoneSimulatorSDK15_5-15.5.1.1653527639-fixed.pkg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apple iOS/tvOS/WatchOS/Mac Catalyst area emulator Related to an emulator/Simulator
Projects
None yet
Development

No branches or pull requests

3 participants