Debugging iPhone Device Development

Device client and Unwired Server troubleshooting tools for diagnosing Apple® iPhone® 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 Reference for iPhone 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

    Following is a log sample:

    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 – that the client request had invalid credentials, or that authentication failed for some other reason.
        • 403 – that the client request had valid credentials, but that the user does not have permission to access the requested resource [package, mobile business object (MBO), or operation].
        • 404 – that the client tried to access a non-existent package or MBO.
        • 405 – that there is no valid license to check out for the client.
        • 500 – an unexpected (unspecified) server failure.
    • eisCode – not currently used.
    • 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 – describes 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.

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 MMS 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