Implement a SSH client on iPhone - ios

Have anyone known of an open source project to implement SSH client on iPHone ?
I actually need a terminal emulation to run a console application I have, I dont even need to get out of my sandbox. But Havent find any terminal emulation that doesnt infringe apple rules. (-MobileTerminal- just works on jailbroken, and does run my console app) and AFAIK its not possible to implement an Appstore valid version of it because of its forkpty() implementation.
still I see lots of SSH clients (terminal like) on the AppStore that send a recieve data. So there has to be a way to emulate a terminal/console thing on iPhone... thats what I need, but I see no one giving out some source code.

A quick google of mine shows this as a possible option:
http://code.google.com/p/mobileterminal/
It's in the Cydia store as well, and should give you general direction. If you want to look at the final implementation, I recommend Panic Software's Prompt - http://www.panic.com/prompt/support.html

Related

Print raw data in UWP

I'm developing an app in UWP. I need to send to my printer a RAW string (or file) and get that printed. I succed in using the old RawPrinterHelper from here.
I have some problems verifiyng the app using the Windows App Certification Kit.
I get errors like this one :
API ClosePrinter in winspool.drv is not supported for this application type. MyApp.dll calls this API.
I think that DllImport() in RawPrinterHelper is wrong.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way?
P.S. I need to publish the app on the Microsoft Store.
If you have already run the WACK test with the release build, then as the error described there are APIs not supported for the windows store app. More details please reference Supported API test.
Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way
For print relative features in windows store app, please follow this tutorial and the official sample. This provide alternatives to the windows print relative APIs. Details please reference Printing and documents section of Alternatives to Windows APIs in Universal Windows Platform (UWP) apps.
If you want the print feature with no print dialog you may reference this thread.

Is there a way to get the search result i get in the App Store app on the iOS device? ( How to get the ipa file of "App Store"? )

Updated on 2015-11-1:
One solution I am trying is to start App Store using Applium, so that I can record/monitor iOS UI elements. just like what we did Selenium.
Let's treat App Store as a standard iOS app, is it possible to:
uninstall App Store from my iphone.
get the ipa file of App Store
unzip the ipa file and get the app bundle
run Appium with App Store's app file
Is it possible to get App Store 's ipa file?
======
I want to know the position of my apps when I search on the App Store. When I use the iTunes Search API. I notice the result returned from the iTunes search API for a specific search term are different from the result on the iOS App Store app.
I found This Question is also about this, the owner of that has find out the reason about this condition.
But there is no answer to solve this problem.
Actually I've been trying to build the search request, but it cames that the iOS Appstore is using the HTTPs request, so I don't know what to do with this.
Hope someone can help, I'll be very appreciate.
There is at this time no way to specify that you want the results you would get from an iOS device.
The most obvious solution that comes to mind is to build a search request that appears as I it came from ios in your app code.
I'm sure its possible to determine that by basically proxying an actual iPhone using say your router on your home network to log the traffic from an iphone.
Once you have that you can then basically reverse engineer the call in your app code.
As you can refer from Apple's guidance: Search API, there are too many ways of parameter combination.(Parameters includes:term, country, media, entity, attribute, callback, limit, lang, version, explicit, etc.) So it's almost impossible to find out the way of combination that App Store is adapting so as to get the same search results as users get directly from App Store.
You might want to see if you can get this to work:
In Mac OS X:
Launch iTunes
Under Library menu, click on [Apps] menu.
The iTunes will display all installed app
Right-click on one of those apps
Then click “Show in Finder” option
An alternative to this is simply open the directory of .ipa files stored by using this path: User/Music/iTunes/Mobile Applications
This probably only works with apps you downloaded, but it is worth trying.
It's possible to listen in on https connections by installing a trusted ssl certificate on the device and running traffic through a proxy - basically performing a man-in-the-middle attack on yourself. I've previously used Charles Proxy to do this - here's the guide how to set this up. That way you should be able to see exactly what request the App Store app is sending and what response it is getting. And thus it should also be possible to spoof this request and parse the results elsewhere.

Transfer files from computer (Mac) to iOS device (jailbroken if necessary) via USB using terminal

I am looking for a way to transfer files from my Mac to the iPhone via USB, and it needs to be done either using the terminal or programmatically.
So far, I have seen some other questions on that topic on StackOverflow, and the most common reply was to use GUI-tools such as iExplorer. Unfortunately, I cannot use GUI-based tools.
One interesting answer was this one (https://stackoverflow.com/a/15795578/299711), which mentioned the MobileDevice library, but alas, it seems very poorly documented (rather, not documented at all, which is not surprising given the fact that it's a private API).
Another answer I found mentioned fruitstrap (https://stackoverflow.com/a/11061932/299711), however, a) I need to be able to copy files in both directions, and b) I need to copy files that are not contained within an application, but which can be located anywhere on the iOS device.
I would be willing to develop a command-line tool myself, if I were to find any documentation is to how to use the MobileDevice framework. But if there already is such a command-line tool which supports bidirectional file transfers, please point me to it. Also, I do not mind having to jailbreak the device if necessary. Thanks!
There is a way to do this, but you have to jailbreak the device and then install from Cydia AFC2 tweak (if not provided with the jailbreak; the latest version of Pangu includes AFC2).
http://www.iphonehacks.com/2014/06/saurik-afc2-package-ios-7-1-x-full-filesystem-access-usb.html
This way you are no longer limited to the Media folder on the device. For how to implement the comunication, i recomend having a look on a project from Github
https://github.com/Moligaloo/iPhoneFS
The Mobile Device library on PC comes with iTunes, so you have to install iTunes, locate the library and link agains it. Hope this helps
Possible With Jailbroken Device:
install OpenSSH on device-using cydia app
now to tranfer file from MAC to iOS use following command on your's mac terminal
scp filePathForYourFileInMac root#ipaddressOfIPhone:destinationPathInIphone
This will transfer file from your mac to iphone at destination place.
If above command asks for Password, use "alpine"(it is default password for root user on jailbroken device). If you have already changed your root passwd, then use that passwd.

Debug iPad Safari with a PC

I want to test my website on Safari on my iPad. I only have another PC. Is there a way for me to do remote debugging like ADB (Android Debug Bridge) with mobile Chrome? I searched on StackOverflow, seems there is an Adobe Edge Inspect CC, but I don't know if this is a good choice.
Thanks!
Update October 2019
This solution doesn't work for IOS 12+ (resource 1, resource 2).
Updated and tested on 24/6/2017
Using Chrome on Windows 8 and more recent:
Download and install Node
Download and install ITunes and connect it to your Device. (A pop-up should shows to your iPad to get authorization)
. Be sure to allow web inspector in your iPad
Download and install the remote webkit adapter
Using Powershell (As administrator):
npm install remotedebug-ios-webkit-adapter -g
Execute the adapter:
Using Powershell (as administrator):
remotedebug_ios_webkit_adapter --port=9000
You should get a similar output:
C:\Windows\system32> remotedebug_ios_webkit_adapter --port=9000
remotedebug-ios-webkit-adapter is listening on port 9000
iosAdapter.getTargets
...
Open Chrome and go to the following link:
chrome://inspect/#devices
Click on configure next to "Discover network targets" and add the following:
localhost:9000
Make sure to have the web page you want debug open on safari, you should see it on chrome inspector page under Remote Target
Extra step for iOS 11 Thanks to #skaurus
See monkeythedev's answer for the easiest way to debug on a Windows 8+ machine with iOS 9+. I updated my blog post using information from that answer and other sources and also recorded a screenshare. The method below should still work for iOS 8 and down, if needed.
There is actually a pretty easy way to debug a website in Safari on iOS using Firefox on a Windows machine.
NOTE: Ryan wrote in the comments below that this may only work on iOS 8 and down. I am unable to confirm, but be aware.
I wrote a detailed blog post about this, but here are the highlights:
Install iTunes to get the "Apple Mobile Device Support" and "Apple Application Support" applications that come with it. (uninstall iTunes afterward, if you want)
Connect your iOS device via USB.
Enable web inspector on iOS (available on iOS 6 and later).
Open Safari on your iOS device and browse to a website.
Open Firefox on your Windows machine and press Shift + F8 to open WebIDE, which should include the necessary Valance add-on, if you use Firefox Developer Edition (any version) or Firefox 37 and later (any channel).
For some reason, I couldn't get it to connect to my iOS device until I downloaded the ios-webkit-debug-proxy-win32 program and ran it. It opens a blank Command Prompt, but after I went back to WebIDE after opening it, I disconnected, then reconnected, and I saw debug info for the website I had opened in Safari. You may not need to do this though, as another user just had to add an exception to their firewall then disconnect/reconnect, and it worked.
The debug info available isn't as exhaustive as Chrome Developer Tools (specifically no "Networking" tab), but it was enough for me to be able to view what was going on in the Console.
2018 Update:
Since the original post, the blog post is dead & Telerik App Builder is discontinued and no longer offered. Adding this update to inform readers in case they don't read the user comments that follow this answer post. As for the blog post, for those still interested, here's a web cached copy. Regarding the blog, I think the company that blog's from has since shut down.
When I get a chance, I'll see if I have a copy of the app builder saved so that I can post it online for those still interested in using it, along with another cached copy of the blog post maybe.
Original Answer
You can try option of using Telerik AppBuilder (Windows client) as a replacement on Windows for Safari debugger on Mac when remote debugging. There's a nice blog post about the steps to do it in link below. I'd rather not repost the info as there are also screenshots and it's a lot of text. But essentially, you install app, open it, connect device via USB, then you can find it in the app and open up the developer tools/debugger for it. For non-public websites, you'll have to open up port 80 with some firewall configs documented in the post.
http://blog.falafel.com/Blogs/josh-eastburn/2014/03/04/ios-web-inspector-on-windows-with-telerik-appbuilder
The tool requires a license or you can use the trial, which becomes a basic edition afterwards. I think the basic edition will still allow you to do the debugging. I'm going to try it out myself.
You can also try these iOS apps too, you can find them in the iTunes App store. They give you a built in developer tools feature (right on iOS no remote debug) that mobile Safari doesn't offer.
MIH Tool - basic edition
https://itunes.apple.com/us/app/mihtool/id584739126?ls=1&mt=8
HTTPWatch Basic
https://itunes.apple.com/us/app/httpwatch-basic-http-sniffer/id658886056?mt=8
I gave them a try and they're at least better than the mobile Safari you get on iOS, unless one needs to target full mobile Safari compatibility. I'm guessing the pro/paid editions of those apps give you more/better features.
This question was more than 4 years ago, but I feel like it's worth to mention another option which is platform-independent which seems is not mentioned above:
VConsole
It's a JavaScript that you can inject into your page(s) which will overwrite all native console output and show it as an overlay on top of your page content, in a level of detail that is almost as good as Google Chrome's Developer Tools.
Runs well on iOS Safari, as well as on other mobile browsers - for as long as JavaScript is enabled in the browser.
How to install: https://www.npmjs.com/package/vconsole
You will need NPM tools to install it, but not actually required to use NPM to build your project. You can simply install VConsole somewhere in a separate folder, and just copy-paste vconsole.min.js from it.
Once you inject it into your page, will look like this:
<script type="text/javascript" src="vconsole.min.js"></script>
<script type="text/javascript>let vc = new VConsole(); // this will initialize it.</script>
Visually is very appealing, you will see green button in lower-right corner of your page on your mobile/desktop browser, which will open console overlay.
Very neat!
Of course, it does not provide you with ability to select an element, see calculated css etc., but if you are looking for console output and some network report, this one is really easy to use.
October 2019
AFAIK, For recent IOS versions there is no overall solution for debugging IOS from a PC.
You can however use one of the following solutions:
Display console messages in the browser itself. As described here and in Sinisa's answer.
The "remotedebug-ios-webkit-adapter" doesn't work for debugging IOS 12+. It requires extra steps for IOS 11, and works for IOS 10 and perhaps older versions as well.
I use PrePros for CSS preprocessing and it has a built in server for mobile debugging and web inspector. But this is only good for local sites even still...
In my experience it is often not an issue with mobile Safari only but Safari in general. In these cases it can help to try the normal Safari (for Windows) and see if the bugs appear there. If so, it's much easier to debug something by this way.
2021 update:
The creator of RemoteDebug here. I've built a replacement for RemoteDebug called Inspect, which packages everything together in a pleasant experience and enables easy iOS web debugging from Windows, macOS, and Linux, with a few extra features like screencasting and wifi debugging.
http://inspect.dev
There are a couple of options I've come across for debugging on iOS. They're not full step-through debuggers, but they offer a JS error log, console and some inspection tools:
1. Eruda
By adding the following snippet to the top of your page:
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
You get an interactive set of developer tools similar to those in Chrome and Firefox. Here's a screenshot:
Available at https://github.com/liriliri/eruda
2. MiniConsole
This one I developed myself when I had not discovered another suitable option. It has less features, but it does the main things - capture JS errors, and allow you to run commands to inspect variables and object on your page.
Here's a demo:
It's activated by just placing this script tag on your page:
<script src="https://cdn.jsdelivr.net/gh/SimonEast/MiniConsoleJS#main/console.js"></script>
Open source, GPL licence. Available at: https://github.com/SimonEast/MiniConsoleJS/
3. vConsole
Another similar option that I've not really tried. Available at https://www.npmjs.com/package/vconsole with a live demo at http://wechatfe.github.io/vconsole/demo.html.
I haven't tried this on a PC, but you should be able to go to http://[DEVICE_IP_ADDRESS]:9999 to debug.

how to debug java app in blackberry

I am developing a bluetooth application for blackberry. I am getting some BluetoothStateException's whil running the app on the phone. I am wondering if there is any way to debug th application on the phone?
Thanks.
UDPATE: There is an option in JDE I found to debug on device, but it keeps asking me to install signing keys.But I have not used any BB API's AFAIK
You cant install a BB app on handset without signing it. Get a developer account on BlackBerry developer website, and you should be able to set up signing, it is almost trivial to do so.
You shouldn't have to sign if you haven't used the BlackBerry APIs that require signing keys. In particular, the basic UiApplication class and the BluetoothStateException don't require the keys.
Having said that, it sounds like you used a protected API in there somewhere (they're really all over the place, the PersistentStore for example, or the Display class in the system package). You can enable warnings within Eclipse for when you use protected APIs. Under Window->Preferences->BlackBerry Java Plug-In, check the Warnings sub-item and make sure all 3 checkboxes are unchecked. Then look at your Eclipse warnings/error view.
Also, I agree with #omermuhammed, it's really easy to get signing keys.

Resources