Estoy buscando instalar los simuladores IOS a través de la línea de comandos. Desde el plist que descarga, puedo ver esto:
<dict>
<key>dependencies</key>
<array/>
<key>fileSize</key>
<integer>584180466</integer>
<key>identifier</key>
<string>Xcode.SDK.iPhoneSimulator.6.1</string>
<key>name</key>
<string>iOS 6.1 Simulator</string>
<key>source</key>
<string>http://devimages.apple.com/downloads/xcode/simulators/ios_6_1_simulator.dmg</string>
<key>userInfo</key>
<dict>
<key>ActivationPredicate</key>
<string>$XCODE_VERSION >= '5.0'</string>
<key>ApplicationsBlockingInstallation</key>
<array>
<string>com.apple.iphonesimulator</string>
</array>
<key>IconType</key>
<string>IDEDownloadablesTypeSimulator</string>
<key>InstallPrefix</key>
<string>$(DEVELOPER)</string>
<key>InstalledIfAllPathsArePresent</key>
<array>
<string>$(DEVELOPER)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk</string>
</array>
<key>RequiresADCAuthentication</key>
<false/>
<key>Summary</key>
<string>This package enables testing of this previous version of iOS by installing legacy frameworks into the iOS Simulator. If your app intends to support this version of iOS, it is highly recommended that you download this package to aid in your development and debugging.</string>
<key>Xcode.SDKs</key>
<array>
<dict>
<key>CanonicalName</key>
<string>iphonesimulator6.1</string>
<key>Path</key>
<string>$(DEVELOPER)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk</string>
<key>Platform</key>
<string>com.apple.platform.iphonesimulator</string>
<key>SupportedDeviceFamilies</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>Version</key>
<string>6.1</string>
</dict>
</array>
</dict>
<key>version</key>
<string>6.1</string>
</dict>
Aquí hay un .dmg
http://devimages.apple.com/downloads/xcode/simulators/ios_6_1_simulator.dmg
y un InstallPrefix.
Dentro del .dmg
hay un .pkg
archivo que se instala en (relativo) ./Platforms
.
El problema es que si intento instalarlo a través de installer
:
sudo installer -pkg /Volumes/.../ios_6_1_simulator.pkg -target /
Se instalará en /Platforms
lugar del previsto /Applications/Xcode.app/Contents/Developer/Platforms
.
No puedo establecer un objetivo diferente que no sea un punto de montaje. ¿Cómo hago para que se instale en esa ubicación?
EDITAR: Ni siquiera funciona si configuro un punto de montaje personalizado. Aquí está mi intento:
$ mkdir /tmp/SampleDir
$ hdiutil create -srcfolder "/tmp/SampleDir" -volname "Sample Install" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size 1g pack.temp.dmg
.............................................................................................................................................................................................................................................
created: /tmp/pack.temp.dmg
$ hdiutil attach -readwrite -noverify -noautoopen -mountpoint /Volumes/SampleDir "pack.temp.dmg"
/dev/disk4 GUID_partition_scheme
/dev/disk4s1 Apple_HFS /Volumes/SampleDir
$ sudo installer -pkg ~/Desktop/iPhoneSimulatorSDK6_1.pkg -target /Volumes/SampleDir
Password:
installer: Package name is iPhoneSimulatorSDK6_1
installer: Installing at base path /Volumes/SampleDir
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
En una situación en la que está instalando un paquete que admite la reubicación, es posible proporcionar un archivo XML de opciones del instalador para installer
modificar las opciones de instalación. Sin embargo, es posible que esto no sea compatible o no esté disponible en todos los paquetes (dependiendo de cómo se haya creado el paquete). Desde la página del manual del instalador :
The customLocation attribute can be set for a choice only if that choice
explicitly allows a user-defined path. That is, if the choice would have a
Location popup when viewed in the Customize pane of the Installer application, it
can be set via customLocation. (Otherwise, installation paths cannot be
arbitrarily modified, since the package author must account for custom install
locations for the installation to work properly.)
Por lo que puedo ver, el iPhoneSimulatorSDK6_1.pkg al que hace referencia no es compatible con esta opción. Sin embargo, todavía es posible realizar la reubicación de la carga del paquete del instalador después de la instalación:
sudo installer -pkg /Volumes/Bittersweet6M149.iPhoneSimulatorSDK6_1/iPhoneSimulatorSDK6_1.pkg -tgt /
sudo mv /Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator/Developer/SDKs
Alternativamente, puede usar pkgutil
para expandir el paquete, cpio
extraer la carga útil y mv
colocar el SDK en su lugar:
pkgutil --expand /Volumes/Bittersweet6M149.iPhoneSimulatorSDK6_1/iPhoneSimulatorSDK6_1.pkg ~/iPhoneSimulator6_1
cd ~/iPhoneSimulator6_1
cpio -i -I ~/iPhoneSimulator6_1/Payload
sudo mv Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator/Developer/SDKs
No estoy seguro de cómo Xcode coloca los simuladores/SDK en la ubicación correcta. Sin embargo, los dos métodos mencionados anteriormente permiten usar el simulador iOS 6.1 dentro de Xcode 5.0.2 en Mavericks (10.9).
San Juan Johnson