Automatically open (iOS) after installing the application

Source: Internet
Author: User
You can use the instruments in the Xcode tool to automatically open the application by executing the script. The following commands are executed:
<p style= "margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px; " ><span class= "PLN" style= "Color:rgb (0, 0, 0);" >instruments </span><span class= "pun" style= "Color:rgb" (102, 102, 0); " >-</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >w </span><span class= "str" style= "Color:rgb (0, 136, 0);" ><udid></span><span class= "PLN" style= "Color:rgb (0, 0, 0);" > </span><span class= "pun" style= "Color:rgb (102, 102, 0);" >-</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >t </span> <span class= "pun" style= "Color:rgb" (102, 102, 0); " >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >applications</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >xcode</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "ColoR:rgb (0, 0, 0); >app</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >contents</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >applications</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >instruments</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >app</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >contents</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >plugins</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span>&Lt;span class= "Typ" style= "Color:rgb (102, 0, 102);" >automationinstrument</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >bundle</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >contents</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >resources</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >/</span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >automation</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >tracetemplate </span><span class= "str" style= "Color:rgb (0, 136, 0);" ><full_path_to_application></span><span class= "PLN" style= "Color:rgb (0, 0, 0);" > </span> <span class= "pun" style= "Color:rgb (102, 102, 0);" >-</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >e uiascript </span><span class= "pun" style= "Color:rgb" (102, 102, 0); " ><</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >path_to_script</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >js</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >></span> <span class= "pun" style= "Color:rgb (102, 102, 0);" >-</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >e uiaresultspath </span><span class= "str" style= "Color:rgb" (0, 136, 0); " ><output_results_path></span></p>
Where Automation.tracetemplate is a uiautomation template file, it is generally fixed in a Mac device.
<full_path_to_application> application of AppID, need to add double quotes
<path_to_script.js> execute the Test JS script path, need to add double quotes
<output_results_path> test output path, need to add double quotes, can not fill

Write a simple test script to verify:
<p style= "margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px; " ><span class= "KWD" style= "Color:rgb (0, 0, 136);" >var</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" > Target </span><span class= "pun" style= "Color:rgb (102, 102, 0);" >=</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" > </span><span class= "Typ" style= "Color:rgb (102, 0, 102);" >uiatarget</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >localtarget</span><span class= "pun" style= "Color:rgb (102, 102, 0);" > (); </span></p><p style= "margin-top:0px; margin-bottom:10px; padding-top:0px; padding-bottom:0px; " ><span class= "PLN" style= "Color:rgb (0, 0, 0);" >target</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >.</span><span class= "PLN" style= "Color:rgb (0, 0, 0);" >delay</span><sPan class= "pun" style= "Color:rgb (102, 102, 0);" > (</span><span class= "lit" style= "Color:rgb" (0, 102, 102); " >15</span><span class= "pun" style= "Color:rgb (102, 102, 0);" >);</span> </p>
The result of executing the script is to open the application for 15 seconds before closing.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.