How to debug BlackBerry devices on Mac using the filesystem? - blackberry

How exactly do you go about debugging BlackBerry apps that utilise the (BlackBerry's) filesystem on Mac?
I'm currently recording video and detecting when the video file appears on the file system, however due to the restrictions:
The BlackBerry file system is auto-mounted when plugged into a Mac
The app cannot access the filesystem when mounted
These two things have made debugging the app when it uses the filesystem.. impossible! We receive a file system error 1003 which according to the results from google mean it's mounted and you don't have access.
Is there a a simple way to get round this?
I also receive 63 signing emails from RIM. Woe is me

The workaround is a bit cumbersome, but it should work for you.
Implement EventLogger instance in your application.
Log all necessary info via EventLogger
Compile and run your app on the detached device from your computer.
Inspect log (press CTRL and hit LGLG on the device keyboard). As an additional option - automatically export log to a text file stored in the device filesystem (media card) to review it on your computer.

Related

Debugging & accessing NSDocumentsDirectory in real device

I have my apps using NSDocumentsDirectory for saving the downloads & offline data on device. From debugging point of view, I was debugging as usual on simulator & was trying to access the path for these downloads & I was able to do that. I have my doubts as :
I am not able to access the location /var/mobile/Applications/SOME-HEX-CODED-PATH/Documents/ via terminal that was shown in the NSDocumentsDirectory paths during debugging on device. Whereas in iOS Simulator I am able to open , read/ write at that location.
I am not able to browse through the /var/mobile directory as it is not listed in the finder, not even as hidden directory.
Is that directory is mounted on runtime ?
Please clarify.
I am not sure to fully understand your question. You want to access, from your laptop, the filesystem of your device?
You are not supposed to do that on a regular device at least. If you want to browse your documents directory do it through the organiser (Window/Organiser) and then "devices" tab and select your device and your app. You will be able to see your sandboxed filesystem in the bottom part and downloaded its content.

Retrieve files from iOS app Documents folder via command line

For the project I work on, we have to set up performance metrics. The way we do it is that the simulator writes CSV files to a known location. We then retrieve theses files and make graphs out of it. Piece of cake.
We also have these tests running on the device. In that case, the files are created in the Documents directory.
While I can retrieve these files via the organizer, I'd be much more interested in automating that.
How can I retrieve files from an iPhone app via the command line rather than the organizer?
You can actually access the content of your app from your computer, using https://github.com/phonegap/ios-deploy (originally https://github.com/ghughes/fruitstrap) .
It's as simple as :
./ios-deploy --download=/Documents --bundle_id com.mycompany.myapp -2 dest_dir
You can do much more, like listing the content of the app, debug using lldb etc.
You can use iFuse, as part of libimobiledevice
You can not access the documents folder on your iOS device from your computer without itunes.
I run an webserver within my app so i can download the files via http. For zero configuration setup i use Apples Bonjour.
look here:
https://github.com/robbiehanson/CocoaHTTPServer
https://developer.apple.com/bonjour/

Blackberry cfg file not found when device connects to computer and Desktop Manager open

I am storing all the config details to a test.cfg file in my BlackBerry device. So every time when i start the application, the app will check if test.cfg exists. If it exists, then it loads all the configuration from that file and if not, the app will show the config page, then the user can enter all the config details and proceed further.
The above is working fine except one scenario. When the device is plugged in to the system and I open the Desktop Manager and the user opens the application, its directly shows the configuration page even if test.cfg already exists in the device.
Does anybody know the solution for this? or any idea why its behaving like this?
My guess would be that when you connect your device to the computer via USB cable, your computer is mounting the SDCard as an external drive. When it does this, the device will essentially lose access to its SDCard. It needs to do this, because the device software and the desktop computer's software don't want to simultaneously be modifying the same files.
Are you saving test.cfg on the SDCard?
If so, you might want to save the file to the device's internal storage instead, for example, in the PersistentStore.
You could turn off the mass storage feature that makes your SDCard available to the PC, if you prefer to have the media card always available to the app. (if you want to do this, tell me which OS version you're using ... but, understand that this only works for you, and isn't a good solution if you want your users to avoid this problem).
You can also test for the SDCard in your app, programmatically
References
Reference on BlackBerry support forums
Data Storage Development Guide on BlackBerry.com
Go to option -> Device -> Storage and deselect and select the media card support and save it and come out the option.Now try to access the media -> explorer folder u can able to access it and also my apps can read the file when its connecting to USB drive now.

How can I export an iPad app's data to a computer?

I have a simple survey iPad app. The data is saved in a TSV (tab separated file). I'm looking for an easy way to export this TSV file to a computer (without emailing it, if possible, and without doing it through iTunes).
App data on iOS is not directly accessible from a connected computer. It's not like you can mount the iPad's flash drive directly on a computer, navigate to the app's data directory, and copy the file to the computer. You have to have something with rights to access the data.
Some options are:
email or otherwise 'share' the data from within the iPad app.
Make the app's data accessible via iTunes
Turn the app into an FTP client or server
Dropbox integration (There was some problem where Apple was rejecting apps that did this, but i don't know the current state)
Have a look at IExplorer. It's a great little program / app that let's you access your iPad's file system from your computer. You can just drag and drop any file from your iPad to your computer.

How to fix non-replicatable iOS issue? [duplicate]

How to get the CrashReport from iPhone?
Thanks
Vadivelu
Open Xcode. Go to the organizer window. Select one of your attached devices. Look for a tab named 'Device logs' on the right.
Once you have released your app to the public, you will get crash logs from users through iTunes Connect.
Application crash logs are transfered to your computer each time you do a sync with the device, in the iTunes. Thus, first step is to sync with iTunes:
Mac OS X –
On the Mac, crash logs are kept at:
~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
where ~ is your Home folder.
Windows Vista –
Files are located here:
C:/Users/<USERNAME>/AppData/Roaming/Apple computer/LogsCrashReporter/MobileDevice/<DEVICE_NAME>
AppData folder is hidden by default, , so you need to reveal it by typing the address in My Computer’s address bar.
Windows XP –
Location is here:
C:/Documents and Settings/<USERNAME>/Application Data/Apple computer/LogsCrashReporter/<DEVICE_NAME>
is your login username. Application Data folder is usually hidden by default, so you need to reveal it in the same way as in Vista — by typing in and pressing Enter.
check out my blog entry here - http://www.makebetterthings.com/blogs/iphone/how-to-find-crash-logs-for-iphone-applications-on-mac-and-windows/
see Technical Note TN2151
When an application crashes on the
iPhone or iPod touch, a "crash report"
is stored on the device. Crash reports
describe the conditions under which
the application terminated, in most
cases including a complete stack trace
for each executing thread, and are
typically very useful for debugging
issues in the application.
When the user synchronizes their
device using iTunes, crash reports are
copied to a directory on the user's
computer. If the application was
distributed via the App Store and the
user has chosen to submit crash logs
to Apple, the crash log will be
uploaded and the developer can
download it via iTunes Connect. For
applications that have been
distributed using Ad Hoc or Enterprise
methods, getting crash reports
requires user cooperation.
Specifically, the user will need to
retrieve the crash report from the
directory where it was copied by
iTunes. Depending on the platform, the
directory is:
Mac OS X:
~/Library/Logs/CrashReporter/MobileDevice/
Windows XP: C:\Documents and
Settings\\Application
Data\Apple
Computer\Logs\CrashReporter\MobileDevice\
Windows Vista or 7:
C:\Users\\AppData\Roaming\Apple
Computer\Logs\CrashReporter\MobileDevice\
is the user's login name
for the computer. is the
name of the iPod touch or iPhone, for
example, "John's iPhone".
You are only interested in .crash
files. The crash report's file name
begins with the application name and
contains date/time information. In
addition, will appear at
the end of the file name, before the
extension.
You can use Test Flight sdk to get to know the crash report , and also other info related to crash like how did get crashed. Here is the link where you will know how to use::
http://changhoward.blogspot.in/2012/02/ios-developer-how-to-use-testflight-to.html

Resources