Search code examples
iosxcodexcode4buildwireless

Xcode 4.5 - Wirelessly build app on my device


So recently my iPhone 4 decided to stop working and I can no longer connect it to my Mac or PC with a USB (it'll only charge if I connect it to a USB that's in a wall outlet and I have to push the 30 pin connector upwards while inserting) but that's another issue.

The problem is that I can no longer build and test my app on my device. I have my device set up with iTunes so I can do a wireless sync. So other than testing my apps on my device the phone is still 100% usable.

I was reading this other post Xcode 4.2 Support Wirelessly Connected Devices that seems to be talking about wirelessly building apps onto devices. But they also say it was removed in Xcode 4.3.1.

I've never actually used this feature in previous Xcode's so i'm not sure if that's what they were actually for/if they worked well or what not.

Basically i'm asking if anyone knows a way to build my apps wirelessly to my device.

I guess I could build make an AdHoc release, put the app file in my iTunes and sync my device there, but at that point I would rather just borrow a friends device to test on.


Solution

  • You can certainly do this. Make your own app store :)

    First, build your app to an archive (.IPA) file. Next, export your project PLIST file.

    This should look something like this:

    <plist version="1.0">
    <dict>
        <key>items</key>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>[URL]</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.usaa.FileTransfer</string>
                    <key>bundle-version</key>
                    <string>2.21</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>title</key>
                    <string>File Transfer</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    

    Finally:

    1. Ensure that the string entry for [URL] contains the correct path to your archive (IPA).
    2. Create a small HTML page with a download link to that plist file. (see below) Be sure to include the mime-types below!

    3. Navigate to that download link via your iPhone and install!

      a href=itms-services://?action=download-manifest&url=YOURURLGOESHERE>Download App

    MIME Types

    application/octet-stream ipa
    text/xml plist
    

    If you try to navigate on anything other than an iPhone you will get an error about the itms protocol not being recognized. You can test this out on your desktop by right clicking the link, and select copy shortcut. Paste into the url browser, and remove the everything except your plist URL location. This should kick off a download on you browser and you should receive the ipa file (which you can uncompress and check out)

    Find more info here!