IOS Simulator WebApp / Bookmark for testing URL schemes

I am testing a custom URL scheme in my application, and I would like to add a desktop icon that calls this URL. Whenever I request my own URL, it opens my application and then returns the Safari address bar to the previously displayed URL.

I tried to work around this problem by editing the properties of another url like

But this fails because you cannot edit the URL assigned to the desktop.

As a backup, I thought that I have a bookmark for the application, so I tried to add a bookmark to the site, and then change the URL as follows:

but this fails because on the iOS simulator you cannot edit the bookmark URL (although you can do this on the device for some reason).

update: As tkanzakic points out, you can edit bookmarks added by the user, rather than predefined bookmarks

Ideally, I would like to use the desktop application, but instead I would decide to set a bookmark.

Also, due to firewall restrictions, I cannot connect this device to my Apple account, that is, I cannot synchronize my Safari bookmarks.

+4
source share
3 answers

Oh, got it. You can get webapp on the home screen pointing to any URL by following these steps:

  • In mobile safari, go to any web page, click the action button and enter the home screen icon for this web page.
  • Close simulator
  • Open the directory /Users/<USERNAME>/Library/Application Support/iPhone Simulator/6.1/Library/WebClips
  • The webclips folder contains all home screens; Find the one you just created and open the Info.plist file in a text editor.
  • Edit the keys (e.g. URL and Title ) as desired.

When you restart the simulator again, you will point to the new URL as the main screen of the website.

Optionally, you can change the .png icon to change the webapp icon.

+3
source

As a backup, I thought that I have a bookmark for the application, so I tried to add a bookmark to the site, and then change the URL as follows:

but this fails because on the iOS simulator you cannot edit the bookmark URL (although you can do this on the device for some reason).

This is incorrect, you can change the bookmark URL, check this article to find out how you can do this. I did this on the Simulator and on the device.

+2
source

Just create a small application (using Xcode) that opens the URL in the application’s deletion:

 - (void)applicationDidBecomeActive:(UIApplication *)application { [application openURL:[NSURL URLWithString:@"myappscheme://whatever/"]]; } 

Please note that I am using applicationDidBecomeActive: instead of applicationDidFinishLaunching: so that the launcher application will work after it starts earlier.

Alternatively, you can set UIApplicationExitsOnSuspend in Info.plist to force termination.

0
source

All Articles