Friday, June 16, 2017

ASP.NET: include javascript file in asp.net page

1. add the javascript file (for example, test.js) into the script folder

2. update BundleConfig.cs to create a new bundle for the js file
     bundles.Add(new ScriptBundle("~/bundles/test").Include(
                                  "~/Scripts/test.js"));


3. to add the js file for all views, update _layout.cshtml in <head> section
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/test")
</head>

or simple add the below line in any cshtml view
    @Scripts.Render("~/bundles/test")


Fiddler: Replay saved fiddler server response to repeat bug in Fiori client local testing

1. Setup Fiddler trace in customer site. Deleting and installing client app or reseting client app to delete all local cached response from device.

2. Start the client app with Fiddler trace enabled and repeat the issue, save the all session in fiddler trace after the testing

3. In local testing environment, open fiddler from local windows box, and open saved fiddle trace file

4. select and copy all session items and drag&drop to AutoResponder tab

5. url for certain requests may have "smphomebuster=" followed by a random timestamp string, in order to match those requests, delete the part after "smphomebuster=" and then delete the "EXACT:", and also select "Match only once" checkbox from the match rule as

6. select the checkbox of "Enable Rules" to start AutoResponder

7. from iOS device, connect to local Fiddler proxy and using the same fiori url to connect to start the app, and then repeat the same operation as customer does.

Note, not all session can be replayed properly, which needs more investigation


Thursday, June 15, 2017

SCP: testing app discovery service

1. From SCP trial account cockpit, select Services tab
2. Select Mobile Service -> App & Device Management tile
3. Select go to Admin console
4. click and open Applications item on list items on left
5. click Config App Discovery
6. add a new config by clicking "New Application Configuration" buttton

In order for fiori client to get configuration from application discovery service, the Config App Discovery setting in Mobile Secure must have ":1.0" at the end of the app id, the app id is set in appconfig.js or fiori url.

For example: com.sap.fiori.client.debug:1.0

Tuesday, June 13, 2017

Test ios app ipa file using ad hoc provision profile and test fligh

1) Using Ad hoc
When using ad hoc for ios testing, the testing device does not need to install the provision profile, the only thing required from testing device side is adding the device id to the apple developer account device list.

The same certificate used for Apple store distribution can also be used for Ad hoc, so there is no need to create a separate distribution certificate.

1. Add the explicit app id for the testing app in apple developer account
2. create ad hoc provision profile in apple developer account, which associates the appid, and all devices that will be used for ad hoc testing.
3. from xcode project, disable "Automatically manage signing" and set the provision profile to the created one.
4. archive the project
5. export the archive for ad hoc distribution, the ipa file will be created in the output folder.

Note sometimes xcode will generate a generic xcode archive instead of ios archive, most likely that is due to a library project included in the workspace has a header section in build phase, please refer to
https://developer.apple.com/library/content/technotes/tn2215/_index.html#//apple_ref/doc/uid/DTS40011221-CH1-PROJ
for details. To workaround, just remove the library project and direct link to the library's .a file.
In addition, if forgetting to set the app version number will also cause this issue.


2) Using testing flight
When using testing flight, you only need the email of the tester, the device used for testing must use the appid with same email from the tester.

1. build the project and then archive the project. Be sure the certificate and profile are all valid otherwise the app may not install by Test Flight
2. create an app from Apple ITune Connect
3. Upload the Archive from xcode to iTune
4. In ITune, select Test Flight to add the tester with email or add the tester into a group
5. In Test Flight, select Build iOS and make the build ready for testing.
6. select the build for testing and add the tester group or individual tester.