Debugging iOS Device Development

Device client and Unwired Server troubleshooting tools for diagnosing Apple iOS development problems.

Client-Side Debugging

Problems on the device client side that may cause client application problems:
  • Unwired Server connection failed.
  • Data does not appear on the client device.
  • Physical device problems, such as low battery or low memory.
To find out more information on the device client side:
  • If you have implemented debugging in your generated or custom code (which Sybase recommends), turn on debugging, and review the debugging information. See Developer Guide for iOS about using the MBOLogger class to add log levels to messages reported to the console.
  • Check the log record on the device. Use the individual entity class getLogRecords method, or assemble a query using the SUPQuery class and call the database class getLogRecords method.

    This is a sample log format (depending on your query):

    <header> [level]
                    code
                    component
                    entityKey
                    level
                    message
                    operation
                    requestId
                    timestamp

    This log format generates output similar to:

    2010-06-22 10:54:28.927 SAPSimpleApps2[91202:207] [INFO]
        [SAPTest.m:295] entity has a log record:
                    code = 200,
                    component = SalesOrder,
                    entityKey = 500151,
                    level = 3,
                    message = Successful,
                    operation = changeFromData,
                    requestId = 33416006,
                    timestamp = 2010-06-22 03:54:22 -0700
    • code – log record code numbers sent by Unwired Server, based on HTTP return codes.
      • Replication-based synchronization codes:
        • 200 – success.
        • 500 – failure.
      • Message-based synchronization codes:
        • 200 – success.
        • 401 – the client request included invalid credentials, or authentication failed for some other reason.
        • 403 – the client request included valid credentials, but the user does not have permission to access the requested resource (package, mobile business object—MBO, or operation).
        • 404 – the client tried to access a nonexistent package or MBO.
        • 405 – there is no valid license to check out for the client.
        • 409 – back-end EIS is deadlocked.
        • 412 – back-end EIS threw a constraint exception.
        • 500 – an unexpected (unspecified) server failure.
        • 503 – back-end EIS is not responding or the connection is terminated.
    • eisCode – maps to HTTP error codes. If no mapping exists, defaults to error code 500 (an unexpected server failure).
    • entityKey – if this log record refers to a particular row in an MBO table, this field contains a string representation of the primary key for the row.
    • component – if this log record refers to a particular row in an MBO table, this field contains the name of the MBO.
    • level – the log level currently set. Values include: 1 = Trace, 2 = Debug, 3 = Info, 4 = Warn, 5 = Error, and 6 = Fatal.
    • message – the reason for the log record, for example, an error from the server when attempting to process a client replay request for a create, update, and delete operation.
    • messageID – unique log record ID.
    • operation – for log records written by Unwired Server, the operation (such as create, update, and delete) that caused this log record to be written.
    • requestId – for log records written by Unwired Server, the ID of the replay request that caused this log record to be written.
    • timestamp – the date and time the log record was created.
  • If you have implemented onConnectionStatusChange for message-based synchronization in CallbackHandler, the connection status between Unwired Server and the device is reported on the device. See the Developer Guide for iOS for CallbackHandler information. The status reported on the device includes:
    • 1 – device is connected.
    • 2 – device is not connected.
    • 3 – device is not connected because of flight mode.
    • 4 – device is not connected because no network coverage.
    • 5 – device is not connected and waiting to retry a connection.
    • 6 – device is not connected because roaming was set to false and device is roaming.
    • 7 – device is not connected because of low space.

Server-Side Debugging

Problems on the Unwired Server side that may cause device client problems:
  • The domain or package does not exist.
  • Authentication failed for the synchronizing user.
  • The operation role check failed for the synchronizing user.
  • Back-end authentication failed.
  • An operation failed on the remote, replication database back end, for example, a table or foreign key does not exist.
  • An operation failed on the Web Service, REST, or SAP back end. You can find detailed messages in the log record.
To find out more information on the Unwired Server side:
  • Check the Unwired Server log files.
  • For message-based synchronization mode, check the SUPBridge and JMSBridge logs.
Related reference
Sybase Unwired Platform End-to-End Process Flow
Debugging Message-Based Synchronization
Debugging Replication-Based Synchronization
Debugging the Cache
Debugging Data Change Notification
Debugging BlackBerry Device Development
Debugging Windows and Windows Mobile Device Development
Debugging DOE-C End-to-End Process Flow
Debugging JCO End-to-End Process Flow