in ios, mobile

Distributing iOS application for testing and debugging

During development and  testing of mobile application, we need to regularly send application build for tester or client for verification or work.  So it very important to get familiar with number of ways to distribute your iOS application. In this article I will list out 4 such method.

  1. Distributing simulator build for other mac user with Xcode 6.0 or above.
  2. Wireless Distribution  via  www.diawi.com.
  3. Wireless Distribution  via self hosted site.
  4. ipa Distribution.

Distributing simulator build for other mac user with xcode 6.0 or above


From Xcode 8.2 and above

You can simply drag and drop yourappname.app into the simulator.  Simulator will automatically install the app for you.
For Xcode 6.0 and above

I was wondering why facebook request to provide  yourappname.app  when we submit for facebook enabled app for iOS during review.  I knew they are using this build to test and verify the facebook api implementation in our iOS application.   So here’s the answer, which we can use it to distribute  simulator build iOS application to other mac user having Xcode 6.0 or higher.  Now the other user can use this app to install into his simulator and run it as usual. This way iOS developers with  no developer account can share his work with his client.  So no need of developer account,  no need to create provisioning profile, no need to archive project and upload to third party  to get link for wireless installation link.  Seems exciting right . Let’s get into work now.

Apple has introduced an interesting tool with Xcode 6!

simctl

simclt allows you to control the simulators running

run xcrun simctl to get the list of available subcommands. Lots of new options to play around.

 

Here’s the step to follow.

  1. Open your project in Xcode and build and run your project for iOS simulator of your choice.
  2. Zip .app version of your app and send it to other user  via email or other way.
  3. Unzip the file you received from email. and run following command.To install you app

    xcrun simctl install booted <app path>

    To launch the app

    xcrun simctl launch booted <app identifier> or click on the app icon in simulator as usual 

Some time it is possible that the app crash once you open application.  It’s probably because the architecture issues, since we used the device build instead of simulator build. The basic architecture difference between the iphone simulator and iphone device is iPhone simulator uses the architecture i386 or x86_x64 whereas, iPhone device uses the architecture arm64 or armv7 or armv7s. So make sure that you buid your app for iOS simulator.

 

Few simctl commands

  • List all available sum commands
    xcrun simctl
  • List available devices, device types, runtimes, or device pairs.
    xcrun simctl listyou will see some like this.== Devices ==
    — iOS 9.2 –iPhone 4s (F6FE46CF-E096-4527-A7F8-1ECCB01547D1) (Shutdown)
    iPhone 5 (149E9859-5327-4DC0-BE68-52F88511EF00) (Shutdown)
    iPhone 5s (9CDE2E0C-905B-49B4-8768-A0493EDA29F7) (Shutdown)
    iPhone 6 (6DD015EE-7444-479C-B6A5-7F780F63C04D) (Booted)
  • Launch specific simulator
    xcrun instruments -w “iPhone 5 (8.0 Simulator)
  • Lunch specific application in specific simulator.  Copy the UUID of the simulator you want. and run following command
    simctl launch 6DD015EE-7444-479C-B6A5-7F780F63C04D bundle identifier.
  • Open url in specific simulator . you can use booted parameter to specify the currently running simulator or UUID to specify the simulator of your choice.
    xcrun simctl openurl booted http://google.com
  • Add a photo to the photo library on the device
    xcrun simctl addphoto booted ~/Desktop/test.png
  • Reset iOS simulator
    xcrun simctl erase booted

 

Other commands.

create        Create a new device.

delete        Delete a device

erase         Erase a device’s contents and settings.

boot          Boot a device.

shutdown      Shutdown a device.

rename        Rename a device.

getenv        Print an environment variable from a running device.

openurl       Open a URL in a device.

addphoto      Add a photo to the photo library of a device.

install       Install an app on a device.

uninstall     Uninstall an app from a device.

launch        Launch an application by identifier on a device.

spawn         Spawn a process on a device.

list          List available devices, device types, or runtimes.

notify_post   Post a darwin notification on a device.

icloud_sync   Trigger iCloud sync on a device.

help          Prints the usage for a given subcommand.

 

Wireless Distribution  via  www.diawi.com


 

This one is one of the most popular and easy way to distribute your ipa and one of my favourite option.  To distribute your ipa via diawi.com follow below instruction.

  1. Generate ipa using your distribution certificate.
  2. Open  www.diawi.com in your browser.
  3. Just drag your ipa to diawi.com in Upload your app section or click on add files to upload your ipa to diawi.com by clicking submit.
  4. Once completed it will generate a link for you.
  5. Share this link to other users whose device is registered with the used distribution certificate.

Wireless Distribution  via  self hosted site


 

So this option is very similar to the way diawi.com works but in private server.  Previous method work for independent developers but it is not appropriate for company to use. For company this option will give great impression to customers.

We need following 4 setup to make this option works

  1. Website with ssl security (https website)
  2. FTP server and FTP username and password
  3. index.html
  4. AdhocDistribution.plist
  5. demo.ipa

Website with ssl security (https website)

For distribution ipa using apple wireless distribution technology your website needs to use SSL certificate. Meaning you need to access your site https other wise this option won’t works.

FTP server and FTP username and password

Well every website have a FTP server installed, now create ftp user to upload files to your site.

index.html

Update the index.html with

<a href="itms-services://?action=download-manifest&amp;
    url=http://www.bitart.com/WirelessAdHocDemo/AdhocDistribution.plist">
    click this link to install
</a>

 

AdhocDistribution.plist

You’ll notice how the above link references a file named WirelessAdHocDemo.plist. This is a manifest in property list format. It can be generated by Xcode or by some custom script and looks like this,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<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>https://yourdomain.com/demo.ipa</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>com.yourdomain.demo</string>
                <key>bundle-version</key>
                <string>1.0</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>Wireless AdHoc Demo</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

demo.ipa

Finally upload your ipa to server.

That’s it. Now open index.html via https://yourdomain.com/index.html. You will now see the link to install iOS application to your device.

 

ipa Distribution.


This option requires you to zip your ipa and send via email to the recipient. At the other end user need to use itunes and sync device to install.

 

Write a Comment

Comment

Webmentions

  • best online psilocybin store

    … [Trackback]

    […] Info on that Topic: rajantwanabashu.com.np/mobile/2016/09/20/distributing-ios-application-for-testing-and-debugging/ […]

  • counseling san diego ca

    … [Trackback]

    […] Here you can find 59818 more Information on that Topic: rajantwanabashu.com.np/mobile/2016/09/20/distributing-ios-application-for-testing-and-debugging/ […]

  • social media analysis

    social media analysis

    cukvjcnxc ubdkg qtjrlmc eujv yfbrerqvzlsshfx