Blackberry older simulator - blackberry

my client wants me to make an application which works on pre4.0 os... i understand that if i make 1 like that then it wont work on the latest os...
But my actual problem is that though i did the coding correctly coz the application was just a simple WebIcon... i cant load it onto the 7290 simulator...
i tried javaloader -u load MyApp.jad and javaloader -u load MyApp.cod... but i get the following error
Error: unable to open port...
earlier it couldnt find javac... so i placed javac in the System32 folder... now the below shown error is displayed and further the simulator doesnt connect with even the 4.0 IDE....
even tried compiling in the 4.0 IDE itself... but i get the following error...
Error!: Error: java compiler failed: javac -source 1.3 -target 1.1 -g -O -d MyDir
Don know wat to do... plz help...
screenshot of the simulator...
alt text http://www.freeimagehosting.net/uploads/d9e1840ce0.jpg

Well friends at last i tried uploading the applications .cod and .jad along with the optional .jar onto my company's server... and guess wat... it did download using the jar file but after trying all the techniques mentioned here... i guessed this was it...
But the application though gets listed in the applications but doesnt show up on the menu... and neither does it run in anyway...
Hence im closing with the research here... thanx a lot guys...

I load my programs doing the following:
(Note: This is on an Curve 8310--which has a memory card slot--not sure if you can plug in the phone and use it in HardDisk mode)
Plug the phone into the computer to enable HD mode
Copy the .jad, .jar and .cod to the memory card (or device memory in your case if HD mode works for this) of the phone
Click the Media Icon
Open the menu within media and hit explore (Here I have an option for memory card OR device memory) -- Select the device memory
Finally, find and select the .jad file -- the phone will ask if you want to download--just hit yes, and this will prompt for the install
Again, I realize this is a different (older) phone which you are using, so this method may not work.
Hope it helps!
Greg

Related

Debug iOS application on device without symbols

I need to debug the startup for an ios application on an actual device... and by start up I mean the very first instruction that is is executed when the OS hands control over to the app. Not "main". Also, this application doesn't have any symbols (ie. the debug information isn't available.. yet). I don't care if I have to debug at the CPU instruction level. I know how to do that (done it for over 30 years). I want the debugger to stop when control is about to transfer to the app. When I use the Attach|by Name command and run, it just says "Finished running".
Oh, and this application was not built in XCode. It is, however an application I built, signed and provisioned and moved to the device. The application does run since I can see the console output. Just in case you're thinking I'm some hacker trying to debug someone's application.
How's that for a tall order? I'll bet nobody can answer this... I've not been able to find any information on how I could do this with an XCode-built project. I wonder if it is simply not possible or "allowed" by the Apple overlords?
What do you say, Stack Overflow gods?
UPDATE: I should clarify something. This application is not built with any commercially available or open-source tool. I work with a tools vendor creating compilers, frameworks, and IDEs. IOW, you cannot get this tool... yet. In the process of bootstrapping a new tool chain, one regularly must resort to some very low-level raw debugging. Especially if there are bugs in the code generated by the tools.
I'm going to answer my own question because I think I've stumbled upon a solution. If anyone has anything more elegant and simple than this, please answer as well. On to the steps:
Starting with a raw monolithic iOS executable (not a bundled .app, but the actual binary mach-o file that is the machine code).
Create a new like-named empty Xcode project. Build and run it on the device.
Locate the output bundle's .app folder.
Copy the above raw iOS executable over the existing one in the .app bundle's folder.
The application will now have an invalid signature and cannot be deployed and run.
Run codesign against the app bundle (you can find out the command-line by running xcodebuild on the above Xcode project).
In the bundle's .app folder, run otool -h -l on the binary image. Locate the LC_UNIXTHREAD load command and find the value associated with the 'pc' register. This is address where the os loader will jump to your application. If this address is odd, then these are Thumb instructions otherwise it will be ARM (I think that's how it works).
Add a symbolic breakpoint (I used GDB instead of LLDB) and enter the address as '*0x00001234' as the symbol.
Select Product|Perform Action|Run Without Building.
Assuming that GDB is able to evaluate the breakpoint expression and set the break point, and you've selected Product|Debug Workflow|Show Disassembly When Debugging, the process should break at the very first instruction to be executed in the application.
You can now single step the instructions and use the GDB console to get/set register values.
Your question does not make sense - main is the entry point into the application. It is the first code that should be encountered, unless possibly you have initialize() overridden for some classes (but even then I think main would get hit before the runtime).
I think you are seeing some kind of odd error on launch and you think you want to set a breakpoint on entry to catch it, but far more likely what would help you is to describe the problem on launch and let one of the 4000 people who have seen and fixed the same crash help you...
However, if you really want to use GDB to break on an application with no symbols (but that you launch from XCode) you can have GDB break on an assembly address as per:
How to break on assembly instruction at a given address in gdb?
To find the address of main (or other methods) you can use tool or atos, some examples in this question:
Matching up offsets in iOS crash dump to disassembled binary
ADDITION:
If for some reason XCode cannot launch your application for debugging, you could also jailbreak and install GDB on the device itself which would give complete control over debugging. If XCode can launch you application I see no reason why being able to break at an arbitrary memory address does not give you the ability you seek...
One solution for applications with webviews is to run them in the iOS Simulator, and connect to that with the remote-debugger in macOS Safari. This is off-topic but maybe the one or other could benefit.
http://hiediutley.com/2011/11/22/debugging-ios-apps-using-safari-web-inspector/
Or use NetCat for iOS... not the most perfect solution, but at least you see what's going on.

Using Adobe AIR captive runtime, the resulting .exe file exits immediately without error... Has anybody experienced this as well?

I am creating an installer using the Adobe AIR captive runtime feature. Normally, the compiler generates a directory for me with all the necessary files that I then use to generate an .msi installer with.
Before, I could just double click the .exe file in this generated directory and the application would already work. (Good way of checking whether the generated files are valid).
I have now stumbled into the situation where I double-click the .exe file and nothing happens. No error message, no logs, nothing. The .exe file just exits immediately.
I have dug up and older installer of my app and tried to run this, the resulting install works fine. But once I replace my SWF file in the install directory with a new build of my app, I once again have the problem.
So, obviously SOMETHING in the Main.swf doesn't agree with the .exe file, but since there are no error messages or whatever it is extremely hard to figure out what the problem is.
The application runs fine from the IDE, by the way, the problem only occurs when I use it in combination with the captive runtime output.
Has anybody ever experienced something similar? And how were you able to figure out what was going on? Is there some secret place where AIR perhaps logs some errors, or is there a way to convince it to output some kind of error log?
You need to create a blank file with no extension called "Debug" (I used textedit and simply removed the extension manually). Put that in the META-INF/AIR/ folder, next to application.xml. This will cause the Air runtime to run in debug mode.
From what I can tell, if there are any fatal errors (e.g. a certain failover .swz file can't be loaded) then at least you'll be able to see what's going on.
Did you manage to make this work?

Trying to publish an AIR for iOS app using Flash CS5.5, but no ipa is being produced

I've finally obtained an iOS developer license, I've managed to publish a hello world, basic kind of app, get an IPA file and install it on my iphone.
However, now i'm trying something more complex, including using imported libraries. I start the publish process as usual, no error is produced but i'm not getting a message that the ipa is ready.
When i look at the target directory I have folders named like 'AOTBuildOutput5264907783565294361.tmp' with files in them.
Looks like it crashes in the middle, but I get no error message to debug!
Please help me find out where I can read these error messages or provide some other kind of insight!
Thanks in advance
Rotem
I've occasionally run into problems like this. It usually occurs when I'm trying to publish the app from my dropbox folder whilst it is trying to sync.
I can only assume that the problem happens because another application is accessing that file (in my case dropbox).
So make sure nothing else is trying to sync to that folder. Hope that helps.
I ended up moving my development folder to somewhere else in my filesystem and everything went fine. I guess having hebrew charachters in the path didn't work so well for the compiler.

BlackBerry Screen Shot Utility ... Torch 9850 ... a how to guide on creating your own capture script/tool

I am providing this for everyone to hopefully save you some brain damage in finding this yourself.
As I'm working on a BlackBerry project that will run on various devices I ran into an issue grabbing screenshots from the handset (including the Torch 9850 ... not quite as good as my iPhones or my Android EVO or Infuse, but much better than the Storm and finally starting to look like a real smartphone - great performance and battery life too).
Normally I'd use my trusty BBScreenShooter and everything would be fine, but it kept crashing when attempting to capture images on the 9850. I posted a couple of requests for help on this site, but nobody could tell me why my BBScreenShooter was crashing or why I'd get "Retrieving screen <active> data ... Error: buffer too small" when using RIM's JavaLoader utility directly.
For those who didn't know BBScreenShooter delegates the "heavy lifting" to JavaLoader to grab the images.
With the help of Mark Sohm (easily one of the most knowledgable BB guys I know walking the planet) he asked me to verify I was using JavaLoader that is included in the v7 SDK. Turns out I wasn't. Good catch Mark, and thanks!
From the looks of things it appears the earlier versions of the JavaLoader utility have byte[] buffers they use for image capture that are hardcoded ... and too small.
So, for all those who need to capture screen shots from RIM's new 480 x 800 based handsets I have included a quick "how to" guide to help you get productive ASAP.
Step 1 - Make sure you have the v7.0 SDK downloaded (doesn't have to be installed, though I cannot think of a good reason not to). For Eclipse users:
Step 1a) Go to the Help menu
Step 1b) Install New Software menu choice
Step 1c) Add the "BlackBerry - http://www.blackberry.com/go/eclipseUpdate/3.6/java" items in your "work with" field.
Step 1d) Under the "BlackBerry Java Plug-in Category", look for the "BlackBerry Java SDK v7.0.0.X" checkbox and click NEXT.
Step 1e) Accept the license agreements and continue the download and installation process.
Step 2 - Go to the installation directory for your newly added SDK. We're going to grab a copy of the path to the JavaLoader utility and use it within a BAT file that will automate the capture and naming of screen shots. This will be found at /plugins/net.rim.ejde.componentpack7.0.0_7.0.0.28/components/bin/JavaLoader.exe
Step 3 - Create a folder you'd like to use to save screen captures. This will also hold your BAT file as the BAT file is specific to this particular project.
Step 4 - Create the BAT file. In my example here I keep all my IDEs, SDK, ... effectively all development environments on a different hard drive than my OS. I keep these on drive D, but modify your BAT to reflect the location and needs of your configuration.
Step 4a) It's important to turn the echo off, otherwise you will probably be unable to use the icon on the desktop to launch this script/utility.
Step 4b) If your BAT file is running locally (same folder) as JavaLoader then this step will be unnecessary. On the other hand if your JavaLoader is on a different hard drive and tucked away deep in folders then you'll have to "change directory" to get to it. Notice the "/D" switch that is used with the "change directory - cd" command so that we can change drives and paths in the same step.
Step 4c) As I like to use timestamps for part of my file names ... set local variables to represent the current date and time.
step 4d) The following "for" statements parse out the current date and time from my Windows 7 computer into a format that I want to include as the file names for my screen captures ... file name == BlackBerry_<date image was taken>_<time image was taken>.bmp.
Step 4e) Copy the newly created device screen shot that JavaLoader captured to your target folder and use the file name we've just created.
Step 4f) Now that we've successfully got a copy of the screenshot saved in our desired target folder we can delete the temporary image that JavaLoader created.
Step 4g) I echo a little statement that lets me know it all worked.
Example BAT file:
#echo off
cd /D D:\Program Files (x86)\EclipseBlackBerry\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.28\components\bin
JavaLoader screenshot tempImage.bmp
set timestampdate=%date%
set timestamptime=%time%
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set timestampdate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set timestamptime=%%a%%b)
copy tempImage.bmp "C:\Users\CirrusFlyer\Desktop\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
DEL tempImage.bmp
echo Completed "...\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
Step 5 - Close and save your BAT file. I kept the BAT in my actual project folder, then created a shortcut and placed it on my desktop. This way I can have my Eclipse up and running and be debugging the application on my handset, and when I want to grab a screen shot simply double-click the shortcut to execute the capture.
This will create screen shots and place them in the target directory: BlackBerry_2011-10-07_1015 PM.bmp, for example.
Step 6 - Your done. Happy coding. Hope this helps.
My next project: extending Eclipse so that I can do screen captures directly from within the IDE the same way I can when doing Android based programming.

Application not getting deployed on Blackberry simulator

I am tried deploying .cod,.alx.jar files on blackberry simulator 8100;the application is not getting deployed on phone.I am using Blackberry plugin for Eclipse.
How can I solve this issue?
Please help
Update
Hi,
Thanks for your reply.
I am trying to run the application the way you suggested.
Do I need to setup new run configuration every time I run any project?
What should be default value for build configuration ? [Debug,Private,or Release]
Copying the .cod files into the simulator's directory (where all the other .cod files are) and restarting the simulator will work.
Probably though you want to automatically deploy from Eclipse. If this isn't working for you, there are a couple of things to check:
Check that the project has been activated for BlackBerry - from the right-click menu for the project, make sure that Activate For BlackBerry is checked.
If that's already checked (as it is by default when you create a new BB project), then sometimes explicitly building the project will do the trick: From the Project menu, choose Build Active BlackBerry Simulation
EDIT: In response to some comments below I thought of something else. The configuration you choose may have something to do with your problems (BlackBerry -> Build Configurations). The configuration in the JDE Plug-in doesn't affect the code generated, but it does affect which projects are activated for BlackBerry. If you switch configurations, your project may become un-activated.
Since it doesn't affect the code, I usually just pick one configuration and stick with it throughout debugging and release.
You might be missing 'jar' in your PATH. If so, the eclipse BB plugin silently fails and your application won't be pushed to your simulator plugin directory. To see this failure within eclipse, choose 'Project > Build Active BlackBerry Simulation'.
If you don't have jar in your path, then you will see:
I/O Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified rapc executed for the project
So, if your JDK is here:
C:\Sun\SDK\jdk\bin
Then append it to your system environment's PATH variable, then re-run 'Build Active BlackBerry Simulation' and you should see:
rapc executed for the project [YOUR PROJECT]
Here are a couple of ideas:
1) If you have any build errors then the application won't deploy to the Simulator. The Eclipse compiler (that underlines compile errors in red) is different to the "rapc" one that creates the binary for the Simulator. I have heard of situations where the Eclipse build seems to work, but the rapc compile fails - check the Console for the detailed rapc output (this might not look like a normal Eclipse build error).
2) In the Eclipse menu, open BlackBerry -> Configure BlackBerry Workspace.
Under BlackBerry JDE choose Code Signing and make sure the three RIM checkboxes are selected. I had compile errors when these weren't selected.
Under BlackBerry JDE choose Installed Components. Choose to use the Component Package 4.7.0 as I have heard of problems with the 4.5.0 Simulator.
You should delete all these extra answers you posted, or you might get downvotes - they should be comments instead of answers.
Check if your simulator is set up to clean the file system / configuration before launching the simulator. Simulators can be set up like this. If you deactivate it, the application should not disappear.
For future readers, there is another possibility for this issue. Check your workbench project directory (folder) for a ProjectName.err file. This may provide a clue as to why your build is silently failing and thus not deploying. In my case, it was an "Error!907", a new icon I added to my project was too big. There was absolutely no other indications in Eclipse 3.4.1 that there was a problem in my build.
Just ran through the same kind of problem : project compiled fine but didn't deploy on any device or on any simulator, even though the debugger said it was attached !
The problem came from a .zip file that was located in the ./src directory of the project, deleting or moving it somewhere else resolved this case.
I wish I hadn't spend 2+ hours on such a stupid problem :/
I know this is old, but you have to do the "generate ALX" option from right clicking the project menu as well or it won't deploy, at least it doesn't for me.
I ran into the same problem again and none of answers posted here worked for me.
I played around and finally made it work. The problem was that the output file name contained a hyphen ('-'). Changing this name in the Build section of BlackBerry app descriptor did the trick.
I mean, how stupid a developer must be to slip that kind of bug. No error reported and why reject the names with hyphens in the first place? Give me back my two hours RIM "developers"!
I had the same problem. The reason was using 'ΓΌ' character in the title.
I have been facing this problem today, but with a MIDlet project. It turned out to be that I forgot to specify the "Name of main MIDlet class" in the BlackBerry Application Descriptor (BlackBerry_App_Descriptor.xml). Once I specified it the application appeared on the simulator correctly.

Resources