How to reset default app in Android Things OS? - android-things

Yesterday I started an Android Things project and I was testing the app using Android Studio. In order to connect to the device using adb.exe, I used the IP of the android device that I saw on the default OS's app (the starting screen). So, after the yesterday's testing it seems that my app is now the default app even if I don't have it connected to the PC.
The problem is that now I cannot see the device's IP address so I can connect to it using adb.exe.
Is there a way of going back to the default OS's app?
PS. The only solution I found is re-installing the Android Things OS.

To go back to default android thing logo screen.Uninstall the app using
adb uninstall <pkg name>
If you want to connect to AT without knowing ip use following command
adb connect Android.local
Also you can use serial cable to find ip of AT.
If you install multiple apps.AT will ask for your choice as below

uninstall the app using adb
adb uninstall <package-name>
if you have connected a keyboard to the raspberry pi board, you can go to the home screen by pressing escape button

(I don't have enough reputation to comment so I make an answer, sorry)
If you want to know the IP of your Raspeberry from your computer, you can use the ARP table.
From Ubuntu/Linux or Windows, just type arp -a
Your Android Things device will appear in this list with its IP !

If you don't need to uninstall your app, you can just close it:
adb shell am force-stop <package-name>
and of course you can close it from your app:
this.finish();
Also you can show your ip address in your app if you have screen. For me adb connect Android.local doesn't work.

An easy way is to log into your router and see all of the connected devices and pull the ip address from there. Really easy with Google Wifi

Related

ExpoCLI- IOS Could Not Connect to Server

I have been working on a react native project in Windows 10 for a while now using Expo to scan the given QR code and test the app on my IOS device. The other day I ran $expo start and everything seemed to go fine until I tried to load the app on my IOS device. I received this message:
Could not connect to server
I then "Run in Web Browser" which worked fine, so I tried accessing 127.0.0.1:19000 in my Iphone's browser (firefox) and it as well could not connect to server. My phone is connected via wifi which is 2.4 or 5g. I wasn't sure how this would effect this so I used a wifi adapter on PC to match which wifi connection phone and PC were on and that didn't help.
I am using react version 17.0.1, expo version 3.28.5, and "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz"
I have tried:
Turning off windows firewall
Using different Iphones to connect
npm install --global expo-cli
Changing Connection from "LAN" to "Local"
Reinstalling Node
Creating a System Variable called: "REACT_NATIVE_PACKAGER_HOSTNAME" with the value "192.168.2.108". This did change the LAN IP address as intended but it did not resolve the problem. I just got the same message with the new IP address.
This problem just started happening out of the blue and I'm not really sure what to do next. If you need any additional information I'd be happy to give it.
try to use
expo start --tunnel
When you get the message:
"Error loading DevTools ValidationError: "urlType" must be one of [exp, http, redirect, no-protocol]"
Just wait for a bit and the QR code for tunnel will appear. It does the same for me as well.

iOS Swift: find Macbook Computer Name/Ip Address on connected Iphone

For local development, I was hoping to programmatically get the computer name or ip address of the macbook my iphone is connected to. I've been looking at hostess; however, it seems to only provide my iphone's ip address. Is this possible?
Thanks so much for the help!
Dave
What I've experienced is that if you're building an Xcode project on an iOS device, and then run the project with the debugger attached, it routes all of the iOS device's networking through your computer. So it will only show your computer's IP address, not the device's. It looks in the debugger as if that's your iPhone's networking info, but it's really your computer's.

Any way to reboot an iOS Device that is connected to a USB port via terminal (Mac terminal) and enter the appleid through command line?

Ok, SO here is my thing.
I am working on test automation on iOS devices. And here is what I need to do
Detect ios devices connected to through USB hub(achieved)
Reboot the device using its unique udid (achieved)
Upon rebooting, the device will prompt to enter apple id. Now, I want to know is there any way I can enter the apple id to device prompt through my command line.?
I have been on this since 2 days, and without any luck.
Can anybody here, help me out with a probable solution.
Any help is appreciated.
You can do it installing Apple configurator AND issuing comands like cfgutil.
If you simply type in terminal:
cfgutil
You can see.. (among others...)
restart
Reboot attached devices. (supervised only)

Connect to wifi access point using Appium

I work for a company who provides wifi. I have some access point setup and I would like to write some automated tests that simulate the connecting to these access points.
So my test would be something like this:
Launch Device
Go to wifi settings on device
Select wifi you wish to connect to
Verify that the device is able to successfully connect to wifi. (When testing this manually on IOS, our splash page automatically pops up, on Android I generally need to open a browser and then the splash page is displayed)
Is it be possible to use Appium to do this? If so I would really appreciate if someone could provide some more information on how to do this.
Thanks!
You need to fire ADB Command to turn your Wifi On like this
adb -s $PHONESERIAL shell "svc wifi enable"
You can include/fire such command using Appium by including it within your test case (Java Code) Use this to know how to fire ADB Commands problematically

How do I get my iphone to connect to local Xampp server on my mac while testing an xcode app

I am doing a Ray Wenderlich tutorial how to make an app like "Instagram". It's my first time setting up a database. I am using Xampp and hosting on my mac.
I CAN get the app to run with the xcode simulator and I can log in and it works with the server. However when I run my iphone device it runs the app but when I go to login through the app it says "Could not connect to server".
What am I missing? I think all my permissions are set to anybody etc... But again I'm totally new to using a database. It seems though that if the simulator can do it the phone should be able to. Also it's not a provisioning problem, that profile is valid and it wouldn't run on my app if it wasn't. I just cant get to the database from the device.
Any help would be awesome!
If the app isn't able to connect to the server, there might be an issue with the server address.
When running on the simulator, you're still on your mac, so something like http://localhost/DATABASE_ALIAS is enough. But when running on a different device, that is no longer true.
To keep things simple, you should make sure the iPhone is connected to same network as your Mac and then replace localhost with either the Mac local IP or its Bonjour address, for instance: http://YOUR_MAC_NAME.local/DATABASE_ALIAS.
To find out the Bonjour address, open System Settings and find the machine name under Sharing. As an example, if it is called "Herbie MacBook", the address would be "Herbie-MacBook.local".

Resources