Como hacer deploy al ipod sin licencia

Saturday, June 4, 2011

Update: this still works on SDK 4.2 and iOS 4.X - I've just tested it all on a new computer.

Create Self-Signed Certificate


First you'll need to create a self signed certificate and patch your iPhone SDK to allow the use of this certificate:

Launch Keychain Access.app. With no items selected, from the Keychain menu select Certificate Assistant, then Create a Certificate.

Name: iPhone Developer
Certificate Type: Code Signing
Let me override defaults: Yes

Click Continue

Validity: 3650 days
Click Continue

Blank out the Email address field.

Click Continue until complete.

You should see "This root certificate is not trusted". This is expected.

Set the iPhone SDK to allow the self-signed certificate to be used:

sudo /usr/bin/sed -i .bak 's/XCiPhoneOSCodeSignContext/XCCodeSignContext/' /Developer/Platforms/iPhoneOS.platform/Info.plist

If you have Xcode open, restart it for this change to take effect.

Enable Xcode's to Build on Jailbroken Device

On your jailbroken iPhone, install the app AppSync.

Remove SDK requirements for code sign and entitlements (I'm loving sed!):

sudo /usr/bin/sed -i .bak '/_REQUIRED/N;s/YES/NO/' /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/SDKSettings.plist

Conclude the requirement removal through patching Xcode. This means binary editing:

cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255
printf "\xc3\x26\x00\x00" >> working
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original
/bin/mv working iPhoneOS\ Build\ System\ Support
chmod a+x iPhoneOS\ Build\ System\ Support

If you have Xcode open, restart it for this change (and last one) to take effect.

Open "Project>Edit Project Settings" (from the menu). Click on the "Build" tab. Find "Code Signing Identity" and its child "Any iPhoneOS Device" in the list, and set both to the entry "Don't Code Sign":



After this feel free to undo step 3. At least in my case it went just fine.

Setting Xcode to code sign with our custom made self-signed certificate (the first how-to). This step can probably be skipped if you don't want to be able to debug:

mkdir /Developer/iphoneentitlements401
cd /Developer/iphoneentitlements401
curl -O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
mv gen_entitlements.txt gen_entitlements.py
chmod 777 gen_entitlements.py

Plug your iPhone in and open Xcode. Open Window>Organizer. Select the device from the list on the left hand side, and click "Use for development." You'll be prompted for a provisioning website login, click cancel. It's there to make legitimate provisioning easier, but doesn't make illegitimate not-provisioning more difficult.

Now You have to do this last part for every new project you make. Go to the menu Project > New Build Phase > New Run Script Build Phase. In the window, copy/paste this:

export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
/Developer/iphoneentitlements401/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
fi


http://stackoverflow.com/questions/246422/how-can-i-deploy-an-iphone-application-from-xcode-to-a-real-iphone-device

Compilar para Iphone Firmware 2.2.1 y Firmware 3.x.x

Friday, June 26, 2009

al comenzar el desarrollo de aplicaciones para iphone llegamos a un punto donde nesesitabamos probar lo que teniamos en el xcode en un iphone o ipod touch, ya que el simulador del xcode no tenia estas opciones, en este punto es donde hay que comprar una licencia de desarrollo para iphone que tiene un costo de $99 dolares, con la cual uno tiene posivilidad de poner en venta lo que se desarrolla y poder probar en el iphone la aplicacion que se esta desarrollando en el momento...

como nos parecia un poco injusto estas medidas estuve buscando otro modo de lograr esto, donde di con una web donde explicaban como hacerlo con un makefile... y quize publicar aqui como hacerlo y que modificaciones hacerle a los archivos...

*antes de empezar vale aclarar que esto funciona con un iphone con jailbreak, hay que tener la aplicacion openssh instalada desde el cydia, y con el iphone conectada a la misma red del mac.

en este tutorial pondre 2 versiones, para compilar para el firmware 2.2.1 y el firmware 3.x.x , ya que en el 3.x hay que hacer unas cuantas modificaciones...

para Firmware 2.2.1
usar estos archivos:
ldid_intel
makefile

para Firmware 3.x
usar estos archivos:
ldid_intel
makefile

los makefile no son los mismos
-------------

una vez probado en el simulador y sin errores ni warnings(preferiblemente), hay que copiar el ejecutable ldid_intel y el archivo makefile en la carpeta del proyecto.

* el programa funcionando en el simulador con la version de firmware q se desee compilar, igual que tener los archivos adecuados.

hay que darle permisos 777 al ejecutable ldid_intel , por terminal entrar a la carpeta del proyecto y copiar

chmod 777 ldid_intel


cuando se hace esto el archivo queda con icono negro.


luego abrir el archivo makefile y editar lo siguiente:

PROJECTNAME
= nombreproyecto

IPHONE_IP = ip del iphone o ipodTouch

lo que dice LDFLAGS son los frameworks que se usan en la aplicacion, si se uso uno externo(que toca importarlo en el xcode),se agrega ahi para que pueda compilar, o le quitan el comentario ( // )

en RESDIR=./Resources ponen el directorio de los archivos externos que se usan(musica, videos, imagenes….) todos los archivos quedan ahí sin directorios internos


ahora por teminal se entra a la carpeta del proyecto y se copia:

make


make install


al hacer make se compila y no debe aparecer ningun error, al hacer make install se instala en el iphone por ssh, cuando pida contraseña ponen la contraseña de acceso ssh(por defecto alpine ).


para desinstalar la aplicacion del iphone se usa
make uninstall


si no les da el comandoanterior usan este
make uninstall2


para limpiar la carpeta del proyecto con todos los archivos generados durante este proseso se usa:
make clear


*depues de instalar si se modifica la aplicacion y se quiere volver a instalar toca desinstalarla y luego darle install otra vez.

cualquier duda o si les aparece error al hacer el make o el make install hacen un replay con el error, les respondo con el que hacer...

Simon Says

Tuesday, April 7, 2009

coming soon on appstore...