RevealServer Configuration Options
Logging Levels
You can control the level of information that Reveal logs using
the user defaults key, IBARevealServerLogLevel
.
The following logging levels are available, and the default
levels are ERROR,WARN,INFO
:
NONE
DEBUG
INFO
WARN
ERROR
The logging level is usually configured via a launch argument passed to your app by Xcode:
- Select the scheme for your app ("_Product → Scheme →
Your Scheme_")
- Edit the scheme ("_Product → Scheme → Edit
Scheme…_" or ⌘<)
- Navigate to "_Run → Arguments_"
-
Insert a new argument using the "_+_" button at the bottom of the "_Arguments Passed On Launch_" table, and enter the following:
-IBARevealServerLogLevel LEVEL1,LEVEL2,LEVEL3
As shown above, multiple levels can be specified, separated by a comma.
-
Click "_Close_"
-
Run your app — you should now see Reveal Server logging to Xcode's console (or not, if you set the level to
NONE
)
Stop Reveal Server from Automatically Starting
By default, Reveal Server will automatically start when your iOS application starts, and when the application is brought to the foreground. You can prevent this by using a launch argument passed to your app by Xcode:
- Select the scheme for your app ("_Product → Scheme →
Your Scheme_")
- Edit the scheme ("_Product → Scheme → Edit
Scheme…_" or ⌘<)
- Navigate to "_Run → Arguments_"
-
Insert a new argument using the "_+_" button at the bottom of the "_Arguments Passed On Launch_" table, and enter the following:
-IBARevealServerDisableAutoStart YES
-
Click "_Close_"
-
Run your app — you should now see Reveal Server logging to Xcode's console that it has not automatically started.
You can now start Reveal Server manually at a time of your own choosing.
Communication Port
By default, Reveal Server automatically selects a high range port for communication. In most environments, this is fine, however it is possible to force Reveal Server to advertise a single port of your selection for communication.
To do this, configure the port via a launch argument passed to your app by Xcode:
- Select the scheme for your app ("_Product → Scheme →
Your Scheme_")
- Edit the scheme ("_Product → Scheme → Edit
Scheme…_" or ⌘<)
- Navigate to "_Run → Arguments_"
-
Insert a new argument using the "_+_" button at the bottom of the "_Arguments Passed On Launch_" table, and enter the following:
-IBARevealServerPort PORT
Where
PORT
is the port you want to use to communicate with your iOS app. -
Click "_Close_"
-
Run your app.
NSUserDefaults
If you wish, you can also set the configuration options above
using standard NSUserDefaults
from within your iOS
app. Note that for these defaults to take effect they must be set
very early in the lifecycle of your app (before the
UIApplicationDidBecomeActiveNotification
notification
is posted by UIKit).