Blackberry console output - blackberry

I am new in black berry development, just like console output in J2me development and log cat in Android to see the event log of the simulator, is there anything for Blackberry so that I can keep a track on application logging on Blackberry.

We can use System.out.println to print something to console.
Also we can use EventLogger to log events to device system log (to view the current event log for the device, go to home screen hold down the ALT key and type "lglg"). Its more fun since we can filter logging by source and priority. Event log file also may be downloaded from device with command:
javaloader.exe -u eventlog > eventlog.txt
See article about javaloader
Also, consider to use some custom logging with microlog lib.

You can use System.out.println() and it will appear in the output window in Eclipse. I would suggest putting some wrapper class around it to emulate some of the features of LogCat, such as making static methods that tag each with [DEBUG], [ERROR], stuff like that. Also, there will be a good bit of other debug output from the simulator/device, so find a way to distinguish your logs (I prepend ========== to each of them so I can see it quickly).

Related

React Native events do not work

I have a trivial react component that only shows a button:
<Button onPress={() => console.log("test")} title="Button"/>
When I put this button into a project I created with react-native init, it works as expected.
However, I have an existing project into which I integrated React Native (0.51.0) manually (because it doesn't use cocoa pods; I followed this guide: https://medium.com/#joshyhargreaves/adding-react-native-to-existing-ios-project-without-cocoapods-6f1ee9106009).
The project seems to work fine: the UI loads, the button gives visual feedback when I tap it. But the buttons onPress event is not fired, so it does not log anything.
There are no errors or warnings (except Class RCTCxxModule was not exported, but it seems to be safe to ignore this).
I'm now out of ideas of what I could try or how I could debug this issue short of diving into Reacts touch handling code. Here's what I tried:
Made sure to only have one RCTRootView, and that it is created in the main thread.
Checked for any suspicious things happening in the remote debugger; everything looks normal (no exceptions thrown or warnings logged).
Tested a few other components that should fire events; for example, TouchableOpacity does not work either.
Logging something after a timeout does work, so it doesn't seem like anything is deallocated prematurely
Checking for errors reported by the metro bundler: it doesn't print anything
Any ideas on what I need to do to get my button to print "test" when I tap it?
I think you have not Debug JS Remotely option enabled. If you don't you have to open React Native Debug Menu Pressing (command / control) + D or shake your device if you are debugging with real device. Then just press Debug JS Remotely and it should appear in the Google Chrome. Then inspect and open the console. There it is!
This mite caused by date diff between the host (your computer) and the client (the mobile device)
You can check this by running adb shell "date" && date
to see if there is a diff.
If there is one go to your mobile device and toggle automatic date & time off and back on.
Then test time diff again as mentioned, if there is no more diff, tap events should work in debug mode
More details in the original git issue answer by - Alex Ciarlillo

JailBreak iOS: adding custom view to input call view

I need to add my custom view to input call view. I have got jail broken device with iOS 9.3.2. I've installed Theos to my MacBook. I've installed mobile substrate to iOS. And now I don't know what I need to do.
I found that I have to modify InCallService.app. But I cannot find needed class for tweak.
Also I don't understand how can I write logs. I tried to use NSLog(#"aaa") and %log(#"aaa") but I cannot find file with logs.
Thank you.
If you want to add something to the app, modifying the .app isn't the easiest way. If you have MobileSubstrate installed you can hook a method from the Phone application and using basic iOS paradigms like MVC you can find the views you need to modify and go from there. If you need the header files you can either dump them yourself with class-dump-z or see if these are still valid.
Logging data is also quite easy with Ryan Petrich's deviceconsole
Just run the command deviceconsole --process < YOUR HOOKED PROCESSES' NAME > in your console after installing deviceconsole onto your Mac, and anything in your code using %log(); will show up in the console.

view iphone console logs without a mac

Is there a way to view the iphone console logs without having a mac ?
It used to be possible using the iPhone Configuration Utility but it does not seem to be available any longer.
I saw a tool called iTools but it seems to require a 32bit version of itunes which is also not available any more.
Given an iPhone device + windows + linux, Is there any workaround / tool to view the iphone console logs?
Realizing it is over half a year ago you asked this, but since it does not have an accepted answer yet:
I ran into this very same issue over and over, and got fed up with it, so I decided to have a go at writing a script that displays console messages in HTML, so you can just view everything in the webpage itself, without having to resort to a console-replacement or a tedious remote debugger (for which you, indeed, require a Mac), without having to modify each console call in existing code.
The key lies in 'replacing' the four main functions in window.console: log, warn, error and trace. This is done by redifining each method, adding own code to that, and calling the original method in the end. Jakub Fiala wrote the basic script for that, on which I built the rest: https://gist.github.com/jakubfiala/8fe3461ab6508f46003d
I dubbed it 'MobileConsole'. It is quite unobtrusive and will 'catch' all console.log (or .warn, .error or .trace) events, and even bind to window.onerror.
I have created a separate page for this script with an elaborate explanation on how it works, including a demo, over here.
Download this from the app store onto the iphone, you can then view logs directly on the phone:
https://itunes.apple.com/us/app/console/id317676250?mt=8
Please note, this is an old app, it will crash when launched, then on reopening it will show you the device logs.
If that fails, here is a link to the iPhone configuration utility for windows:
http://download.cnet.com/iPhone-Configuration-Utility-for-Windows/3000-20432_4-10969175.html

How to clear Editor log and Trace Log when using Automation Instrument

I am using Automation Instrument to test out my iOS app. I was wondering how can I delete my old log messages from the Editor log and Trace Log?
The only way I know is to close my Profile window, open a new one and load in my JavaScript files in again. But there must be a simpler and smarter way to do this.
Unfortunately There is no simple or smarter way to do this yet. You need to restart the instruments IDE to clear the editor log. Alternatively you can wrap your code b/w logstart and logpass/logfail methods as below.
//Begin
UIALogger.logStart("Script start");
/* your test code
.......
*/
//End
UIALogger.logPass() or UIALogger.logFail() or UIALogger.logIssue()
With this you can make editor log grouped under a collapsable anchor and look less clumsy.

Redirect BlackBerry device simulator output to console

I'm currently developing a BlackBerry application using JDE 4.6.1 on Windows XP. Since I'm running the application directly from the console using fledge.exe I would like to know if there is a parameter for redirecting my application output, namely a simple system.out.println call, to the windows prompt console. Right now I'm able to view that output only on the Eclipse console window in Debug mode.
The simulator only outputs through its JDWP interface. If you don't want to use Eclipse, but are ok with a lighter-weight non-command-line tool, you can run the standalone debug server - you'll find a jdwp.bat file under your eclipse\plugins\net.rim.ejde.componentpackX.X.X.X\bin directory.
There may also be command line tools that let you print JDWP info, not sure as I haven't ever used one.
I don't know of a way to redirect the output, but you might consider using the BB event logger. You can use a simple script to extract the logger output

Resources