Latest / CyberCode Academy / Course 5 - Full Mobile Hacking | Episode 1: Android Studio: Running AVDs and Installing Apps on Windows
Transcript
- 0:00Speaker 1: Imagine running a full working mobile phone right in your computer.
- 0:04Speaker 1: I don't mean just a picture of one, but a
- 0:06Speaker 1: phone you can control down to the location, the battery life,
- 0:10Speaker 1: even the cell signal.
- 0:12Speaker 2: Yeah, that's what we're talking about, creating a complete digital
- 0:15Speaker 2: testing lab.
- 0:17Speaker 1: Welcome to the deep dive today. We are bridging that
- 0:20Speaker 1: huge gap between the power you have on a desktop
- 0:22Speaker 1: and the complex reality of a mobile device exactly.
- 0:26Speaker 2: And our mission is to show you how anyone, developers,
- 0:29Speaker 2: security analysts, you name it, can run a totally configured
- 0:33Speaker 2: Android environment. It all starts with a tool called Andraig's Studio.
- 0:37Speaker 1: And the goal is to test a real application package
- 0:39Speaker 1: what's called an APK.
- 0:41Speaker 2: Right, the APK, that's the file that holds everything for
- 0:43Speaker 2: an app, all the code, all the resources, bundled up
- 0:46Speaker 2: and ready to install.
- 0:47Speaker 1: So let's be clear, this isn't some simple screen mirror.
- 0:50Speaker 1: We're talking about building a dynamic environment, one where you
- 0:53Speaker 1: have total control and I think this is key, where
- 0:55Speaker 1: you can repeat your tests perfectly every time.
- 0:58Speaker 2: That's the whole point, reproduce stability.
- 1:00Speaker 1: We're going to unpack the whole thing, the setup, building
- 1:04Speaker 1: the virtual phone, using those advanced controls, and then actually
- 1:07Speaker 1: pushing a real app like a messaging app right onto.
- 1:11Speaker 2: It sounds like a plan.
- 1:12Speaker 1: Okay, so let's start at square one before we even
- 1:15Speaker 1: think about building this virtual phone. What are the absolute,
- 1:19Speaker 1: rock solid components we need inside Android studio.
- 1:23Speaker 2: The absolute core is the Android SDK.
- 1:27Speaker 1: The Software development kit. Yep.
- 1:29Speaker 2: Just think of it like a toolbox. It's got all
- 1:30Speaker 2: the necessary libraries and tools you need to build apps
- 1:33Speaker 2: and well to communicate with the Android operating system itself.
- 1:38Speaker 1: You have to make sure that's installed first you do.
- 1:40Speaker 2: And more than that, you need to make sure you've
- 1:41Speaker 2: downloaded the specific the API levels you want to test against.
- 1:45Speaker 1: And why is choosing that API level so important?
- 1:48Speaker 2: Well, because it literally determines which version of Android your
- 1:51Speaker 2: virtual device will run. If you're testing for say an
- 1:55Speaker 2: older phone, you might need something like Android five point one,
- 1:58Speaker 2: But if you want to test the latest features or
- 2:01Speaker 2: maybe some new security stuff, you'll need the newest API
- 2:04Speaker 2: like Android ten point zero, which you might see labeled
- 2:07Speaker 2: as Q in the settings.
- 2:08Speaker 1: So let's you match the real world environment.
- 2:10Speaker 2: Of your users precisely. You can test your ADK against
- 2:13Speaker 2: the exact ecosystem people are actually using.
- 2:16Speaker 1: So once that STK foundation is solid. We move from
- 2:21Speaker 1: the toolbox to what the control room.
- 2:24Speaker 2: You can call it that. It's the AVD Manager.
- 2:26Speaker 1: AD.
- 2:26Speaker 2: AVD stands for Android Virtual Device Manager. This is basically
- 2:31Speaker 2: your fleet headquarters. It's the list of every single virtual
- 2:35Speaker 2: Android device you've created on your machine.
- 2:37Speaker 1: It's where you manage all the phantom phones exactly.
- 2:39Speaker 2: It's where you define their hardware, their software, everything.
- 2:42Speaker 1: All right, let's build one. Walk us through it. What's
- 2:44Speaker 1: the first click inside the AVD manager.
- 2:47Speaker 2: The first step is a big button that says create
- 2:49Speaker 2: virtual device. Simple enough, huh. And right away you have
- 2:52Speaker 2: to choose the form factor. Are you building a phone,
- 2:55Speaker 2: a tablet, something for a TV, or even a Warros watch.
- 2:59Speaker 1: For ours, we're sticking with a phone, maybe a pixel
- 3:02Speaker 1: three something common.
- 3:03Speaker 2: Good choice. So you select that virtual chassis, that pixel
- 3:06Speaker 2: three profile, and the next step is to give it a.
- 3:09Speaker 1: Brain, meaning the operating system, the system.
- 3:12Speaker 2: Image you got it. You match your hardware choice with
- 3:15Speaker 2: one of the system images from that SDK liss we
- 3:18Speaker 2: just talked about. So you pair the pixel three with
- 3:20Speaker 2: say Android ten.
- 3:21Speaker 1: Point zero, and then you finalize it.
- 3:23Speaker 2: Then you finalize, give it a name you'll remember, set
- 3:26Speaker 2: the orientation. Usually portrait and confirm the performance settings. But
- 3:31Speaker 2: there's a really important step here, especially for anyone doing
- 3:34Speaker 2: serious testing. Ah, the advanced settings right, running a whole
- 3:37Speaker 2: OS inside a window is.
- 3:40Speaker 1: Well, it's heavy on your computer's resources.
- 3:42Speaker 2: So what should we be looking at in those advanced settings.
- 3:44Speaker 2: We don't want the emulator itself to mess up our
- 3:47Speaker 2: test results.
- 3:47Speaker 1: That's a critical point. You want to look at the RAM,
- 3:50Speaker 1: the virtual RAM. It often defaults to something like fifteen
- 3:53Speaker 1: hundred and thirty six megabytes, but you can and probably
- 3:57Speaker 1: should adjust it based on your machine and what you're doing.
- 4:00Speaker 2: Testing and other VM settings. Yeah, you can tweet the
- 4:03Speaker 2: graphics performance, the internal storage size. Optimizing these is vital
- 4:07Speaker 2: if you want to avoid false positives, you know, thinking
- 4:10Speaker 2: your app is slow when it's really the emulator that's struggling.
- 4:13Speaker 1: Okay, so we've locked all that down.
- 4:14Speaker 2: We hit launch and you'll see the Android logo pop up.
- 4:17Speaker 2: A few moments later, you have a complete operational phone
- 4:20Speaker 2: sitting right there on your desktop.
- 4:22Speaker 1: And you can test it right open Chrome, go to
- 4:24Speaker 1: a website.
- 4:25Speaker 2: Absolutely, check the internet connection, make sure everything works just
- 4:28Speaker 2: like a physical device. But this is just the beginning.
- 4:31Speaker 2: The real power isn't just that it works, it's that
- 4:34Speaker 2: you can control it.
- 4:36Speaker 1: This is the part that I find really fascinating. We're
- 4:39Speaker 1: not just launching a phone, we're controlling its entire universe.
- 4:43Speaker 1: These extended controls sound incredibly powerful.
- 4:46Speaker 2: They are. They are essential for any kind of deep
- 4:49Speaker 2: testing or security analysis. You find them under the more option,
- 4:53Speaker 2: that little three dot menu on the side of the emulator.
- 4:55Speaker 1: Okay, so let's start with location. You mentioned being able
- 4:58Speaker 1: to set it to Singapore. Why is that it's so important, Well,
- 5:01Speaker 1: think about it.
- 5:02Speaker 2: Imagine an app that's only supposed to work in a
- 5:05Speaker 2: certain country geofencing, right, you can test that instantly without
- 5:09Speaker 2: getting on a plane. Or from a security perspective, you
- 5:13Speaker 2: can see how a malicious app behaves when it suddenly
- 5:16Speaker 2: thinks it's in a different country. Does it trigger some
- 5:18Speaker 2: hidden function? It's instant, repeatable geographic mobility.
- 5:23Speaker 1: And what about something that affects every user every day,
- 5:27Speaker 1: the network connection?
- 5:28Speaker 2: Ah? Yes, under cellular and networking you get strategic control.
- 5:32Speaker 2: It's not just about picking between LTE or GSM. You
- 5:35Speaker 2: can actually control the signal strength.
- 5:37Speaker 1: So you can drop it down to one bar.
- 5:39Speaker 2: You can drop it to one bar, you can set
- 5:40Speaker 2: it to poor. You can even make it unregistered. You
- 5:43Speaker 2: can watch in real time how your app handles a
- 5:46Speaker 2: sudden disconnection while it's trying to send data. That is
- 5:49Speaker 2: priceless for preventing user frustration.
- 5:51Speaker 1: And then there's the battery, the classic app killer of.
- 5:54Speaker 2: Course, the power. In battery controls, you can set the
- 5:57Speaker 2: charge level to say five percent, and then toggle whether
- 6:01Speaker 2: it's plugged in or not, so you can.
- 6:02Speaker 1: See if your app suddenly becomes a battery vampire when
- 6:06Speaker 1: the charge is low.
- 6:07Speaker 2: Exactly, you can really measure that power consumption accurately and
- 6:11Speaker 2: under very specific conditions.
- 6:13Speaker 1: What about the physical parts, the sensors.
- 6:15Speaker 2: Even those are virtualized. Under the sensor's controls, you can
- 6:19Speaker 2: manually trigger the accelerometer or the gyroscope. You can simulate
- 6:24Speaker 2: a phone tilt or a rotation to see if your
- 6:26Speaker 2: gaming app crashes.
- 6:27Speaker 1: You can even simulate plugging in headphones YEP.
- 6:31Speaker 2: Or change the virtual phone number to test calls and texts.
- 6:34Speaker 2: It's all about creating a specific, controlled scenario.
- 6:38Speaker 1: It's just amazing. The level of control means every single
- 6:41Speaker 1: test can be perfectly reproduced. You fixed every variable outside
- 6:45Speaker 1: of your own.
- 6:45Speaker 2: Code, and for documenting all this. Don't forget the built
- 6:48Speaker 2: in utilities. You can save a device snapshot like a
- 6:51Speaker 2: perfect say state before you run a risky.
- 6:54Speaker 1: Test, so you can just wervert back if something goes
- 6:56Speaker 1: horribly wrong instantly.
- 6:57Speaker 2: Plus you can record the screen and even share the
- 7:00Speaker 2: clickboard between your computer and the virtual phone. It saves
- 7:02Speaker 2: so much time.
- 7:03Speaker 1: Okay, so our perfect testing lab is running. It thinks
- 7:06Speaker 1: it's in Singapore. The LTE connection is poor, the batteries
- 7:09Speaker 1: at ten percent. Now we need to install our app
- 7:12Speaker 1: our APK file. How do we do that without the
- 7:15Speaker 1: Google Play Store.
- 7:16Speaker 2: For that, we turn to the most essential command line
- 7:20Speaker 2: tool in the Android world, the Android debug Bridge ADB ADB.
- 7:25Speaker 2: It is the bridge between your host computer, your Windows machine,
- 7:29Speaker 2: your Mac and the Android device, whether it's this virtual
- 7:33Speaker 2: one or real one plugged in with a USB cable.
- 7:35Speaker 1: It's how they talk to each other.
- 7:36Speaker 2: It's how you get remote control. It gives you low
- 7:38Speaker 2: level access right into the device's shell.
- 7:41Speaker 1: So without getting lost in the exact commands. What's the
- 7:44Speaker 1: concept here? What are the steps to push our app
- 7:47Speaker 1: package across that bridge?
- 7:48Speaker 2: It's really a three stage process. Firstus just preparation. You
- 7:51Speaker 2: have your APK file, let's say it's WhatsApp, and you
- 7:53Speaker 2: make sure your command prompt is looking in the right folder.
- 7:56Speaker 1: Simple enough.
- 7:56Speaker 2: Second is verification. You have to make sure the bridge
- 7:59Speaker 2: is actually connect. You run a simple command ADB devices
- 8:02Speaker 2: and it should list your running emulator with its unique name,
- 8:06Speaker 2: something like emulator five.
- 8:07Speaker 1: Five five four, so it confirms the target is there
- 8:10Speaker 1: and ready. And the final stage.
- 8:13Speaker 2: The final stage is installation. You use an ADB command
- 8:17Speaker 2: to point to that specific emulator by its name, and
- 8:20Speaker 2: you tell it to install your APK file.
- 8:22Speaker 1: You're basically giving the operating system a direct order.
- 8:25Speaker 2: You are. You're saying, here's a package, install it now.
- 8:29Speaker 2: You bypass all the normal storefront procedures and.
- 8:32Speaker 1: The magic word we're looking for, and the command prompt.
- 8:34Speaker 2: Is success, a single beautiful word.
- 8:37Speaker 1: Huh. Once you see that, you can just go into
- 8:39Speaker 1: the virtual phone, open the app drawer.
- 8:42Speaker 2: And there it is freshly installed. You've maintained the total
- 8:45Speaker 2: control over the entire process, which for security testing is
- 8:49Speaker 2: absolutely vital. You might be analyzing an app that isn't
- 8:52Speaker 2: even on the play Store.
- 8:53Speaker 1: This really completes the whole cycle. We started with the
- 8:56Speaker 1: basic framework and Android Studio. We built the custom virtual device.
- 9:00Speaker 1: We use those deep controls to simulate really complex conditions,
- 9:03Speaker 1: and then we pushed a real app onto it using ADB.
- 9:06Speaker 2: And if we just zoom out for a second, what
- 9:09Speaker 2: you've created is a true digital clean room. For a developer.
- 9:13Speaker 2: That means better repeatable quality testing. For security analysts, it
- 9:18Speaker 2: means you can run a suspicious APK in a totally
- 9:21Speaker 2: isolated box right.
- 9:22Speaker 1: Without any risk to your actual.
- 9:24Speaker 2: Computer exactly, and you can poke and prod it with
- 9:27Speaker 2: all these different environmental variables to see if you can
- 9:29Speaker 2: trigger some kind of malicious behavior.
- 9:31Speaker 1: That brings up a great question for you to think about.
- 9:34Speaker 1: We've established that the Android debug Bridge ADB let's just
- 9:37Speaker 1: install files. But given that its name has debug bridge
- 9:41Speaker 1: in it, what other critical capability does it provide besides
- 9:45Speaker 1: just file installation, And how would that capability tie directly
- 9:48Speaker 1: into the deep configurations we talked about, like testing network performance.
- 9:52Speaker 2: Well, think about that name. It is a bridge. It's
- 9:55Speaker 2: not just a one way street for pushing files. It
- 9:57Speaker 2: enables full two way remote control. That shell access we
- 10:01Speaker 2: mentioned it lets you RN commands inside the virtual device, so.
- 10:04Speaker 1: You can pull information.
- 10:05Speaker 2: Back out precisely. For network testing, you could push a
- 10:08Speaker 2: test and then use ADB to pull detailed logs into
- 10:12Speaker 2: lemetry about how the connection behave right back to your
- 10:15Speaker 2: computer for analysis. It's not just about control, it's about observation.
- 10:19Speaker 1: An excellent thought to end on the true deep dive
- 10:22Speaker 1: goes beyond the pretty interface right into the command line.
- 10:25Speaker 1: Thank you for joining us today. We really encourage you
- 10:27Speaker 1: to go explore the power of those ADB shell commands
- 10:30Speaker 1: and see just how deep that rabbit hole goes.