I have an x86 API23 AVD (with Google APIs) created with Android Studio 2.1.1 that I need to send GPS coordinates to. I've read extensively on doing this using either 'adb emu geo fix' commands from the command line, or via telnet-- after authenticating, and then sending geo fix commands along with the latitude, longitude, and optional altitude parameters at the command line as well. I'm running my code on a Mac OSX El Capitan box. The problem is that my application-- the app that needs to be fed the GPS coordinates that I'm sending, acts as if it is not getting any data. If I use the Extended controls on the AVD itself to send the same current location with the SEND button, or PLAY out route data loaded from a.gpx file, then all works fine. The app gets the GPS data and behaves as expected. The problem is that I am running test automation (Appium, Java, TestNG) that needs to launch the AVD, then send the GPS data, and then verify that my app under test behaved as expected when it was fed the correct GPS data. This means that I cannot manually interact with the AVD's extended manual controls. [Request] BTStack GPS and Infinidock Request (self.jailbreak) submitted 2 years ago. TheiphoneguyJBQA iPhone 6s Plus, iOS 10.2 -1 points 0 points 1 point 2 years ago (11 children. (subjective) feel, hence Infinidock - I am a little ocd about app icons being on the springboard, I always just set the icon count to 5, and allow scrolling. Send cover letter, resume and Employment Application to Human Resources, 301 E. Irving Park Road, Streamwood, IL 60107 by noon, 01/14/19. I must do this all, programmatically. Here's what I'm doing now via Telnet commands. ![]() ![]() The code looks essentially like so for sending just a 'Current Location': import org.apache.commons.net.telnet.TelnetClient; static TelnetClient tc = null; public InputStream inptStream; public PrintStream outptStream; public String prompt = 'OK'; //Instantiate the telnet client -- we use this to send geo fix commands to the emulator tc = new TelnetClient(); //Connect, this will generate the auth_token if it does not already exist in file system System.out.println('Trying to connect to AVD.' ); tc.connect('localhost', 5554); //Check to see if we are connected Boolean areWeConn = tc.isConnected(); System.out.println('Are we connected?' + areWeConn); // Get input and output stream references System.out.println('Getting input and output streams.' ); inptStream = tc.getInputStream(); outptStream = new PrintStream(tc.getOutputStream()); //wait for OK prompt System.out.println('Waiting for the OK prompt.' ); //Not including readUntil() code because it's just reading terminal output readUntil(prompt); //Send the auth token number System.out.println('Sending auth token.' ); outptStream.println('auth ' + '3A/Yfazi3pRcvNiB'); outptStream.flush(); //wait for OK prompt System.out.println('Waiting for the OK prompt.' ); readUntil(prompt); //Send current location for our Starting Point System.out.println('Sending Current Location - Starting Point'); outptStream.println('geo' + 'fix' + '28.4194 -81.5812'); outptStream.flush(); //Now disconnect from Telnet System.out.println('Disconnecting from AVD.' Torrent alibre design expert for sale.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |